The Structured Text (ST) language supports 3 kinds of loops: FOR … DO … END_FOR: Reapeats some processing for some given iteration count WHILE … DO … END_WHILE: Repeats some processing while a condition is true REPEAT … UNTIL … END_REPEAT: Performs some processing at least once, then repeats it until some condition becomes true […]
Tag: Coding
Edge generation in LD
PLC3000 with the Ladder langage allows the rising and falling Edges. Declaration in LD A rising Edge is defined during the variable declaration in the Ladder code editor. A rising Edge on input %I0: A falling Edge is defined during the variable declaration in the Ladder code editor. A falling Edge on input %I1 :
Programming in LD
1. Example in ST Let’s considering the logical equation: %M0 = %I0.%I1+%I2. /%I3 2. Example of Grafcet in ST Let’s considering the elementary Grafcet a. Programming Transition/Transition Initialization Test on Receptivity and Transition Crossing Output declaration b. Programming Transition/Transition with Crossing bits Initialization Test on Receptivity Transition Crossing Output declaration c. Programming Step/Step d. Programming […]
Programming in ST
1. Example in ST Let’s considering the logical equation: %M0 = %I0.%I1+%I2. /%I3 PROGRAM LogicalFunction %M0 := %I0 AND %I1 OR %I2 AND NOT %I3; END_PROGRAM 2. Example of Grafcet in ST Let’s considering the elementary Grafcet a. Programming Transition/Transition PROGRAM TrTr (* INIT *) IF %S2 THEN %M0 := TRUE; %M1 := FALSE; […]
Programming in IL
c. Programming Step/Step * START LD %M1 AND %I1 OR( %M0 ANDN %I0 ) OR %S2 S %M0 R %M1 * LD %M0 AND %I0 OR( %M1 ANDN %I1 ) S %M1 R %M0 * ACTIONS LD %M1 ST %Q0 d. Programming Step/Step with Crossing Bits * START LD %M1 AND %I1 OR( %M0 ANDN […]
Instructions in IL
The programming language Instruction List (IL) is defined by the IEC 61131 standard. It includes the instructions: LD: LOAD ST: STORE S: SET R: RESET the set of basic logic functions: AND OR XOR: eXclusive OR and their complement: LDN: LOAD NOT ANDN: AND NOT ORN : OR NOT To the logic functions are associated […]
Mnemonics in the IL Language
At each variable can be associated a mnemonic. It is then possible to use the mnemonic or variable completely transparently in programs. To associate the variable Switch to the input %I0, the variables RedLight and GreenLight to the outputs %Q0 and %Q1 respectively, it is necessary to write: %I0 Switch %Q0 RedLight %Q1 GreenLight
System Bits
PLC 3000 has 2 system bits: %S1: for the initialization and setting of timers and counters, %S2: for the initialization of the memory bits. These system bits correspond to Rising Edges correlated to the RUN of the Code and the Reset of the scale models.