SUGIH4D Autom Solusi Super Scatter Zeus Sugih 4D

< All Topics
Print

CoDeSys – boucles

Rappel des boucles sous CoDeSys

CASE
CASE <Var1> OF
<value1>:<instruction1>
<value2>:<instruction2>
<value3, value4, value5>:<instruction3>
<value6 ... value10>:<instruction4>
...
<value n>:<instruction n>

{ELSE <ELSE-instruction>}

END_CASE;

Example

IF THEN ELSE
IF <condition> THEN
    <statements>
( ELSIF <condition> THEN
            <statements> )*
( ELSE
            <statements> )?
END_IF;
// ( ... )* None, once or several times
// ( ... )? Optional

Example

REPEAT
REPEAT
    <instructions>
UNTIL <boolean expression>
END_REPEAT;

Example

WHILE
WHILE <boolean expression> DO
    <instructions>
END_WHILE;

Example

FOR
FOR <counter> := <start value> TO <end value> {BY <increment> } DO
    <instructions>
END_FOR;

Example

Powered by WordPress