Publication 1756-RM084F-EN-P - July 2002
Entering Structured Text Logic 6-3
Structured text STX_ROUTINE example
This is an example of an exported structured text routine.
STX_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;
END_STX_ROUTINE
Entering Comments
Enclose comments between (* and *) characters. Comments can
include carriage returns. You can place comments anywhere in
structured text logic. For example:
(*------------------------------------------------------------------------------------------
----------- Example comment ----------------------------------------------------------------
------------------------------------------------------------------------------------------*)
Spare Allen-Bradley Parts