Download 1756-RM084 - Literature Library

Transcript
Define a structured text routine
Chapter 12
L5X structured text routine example
L5K structured text ST_ROUTINE example
This is an example of an exported structured text routine.
ST_ROUTINE <routine_name>
(*----------- Sample of ST code-----------------------------*)
‘IF (myInteger = 12) THEN
‘
myInteger := ((5 * myInputInteger1) + (7 *
myInteger2)) - 71;
‘
WHILE (myTmpVar >= 0) DO
‘
myInteger := myInteger + 3;
‘
myTmpVar := myTmpVar - 1;
‘
END_WHILE;
‘END_IF;
ND_ST_ROUTINE
Rockwell Automation Publication 1756-RM084Y-EN-P - December 2018
225