Rockwell Automation Logix5000 Controllers Structured Text Programming Manual User Manual
Page 10
10
Publication 1756-PM007D-EN-P - November 2012
Chapter 1 Program Structured Text
Instruction
An instruction is a standalone statement.
An instruction uses parenthesis to contain its operands.
Depending on the instruction, there can be zero, one, or multiple
operands.
When executed, an instruction yields one or more values that are part of
a data structure.
Terminate the instruction with a semi colon “;”.
Even though their syntax is similar, instructions differ from functions in
that instructions cannot be used in expressions. Functions can only be
used in expressions.
instruction();
instruction(operand);
instruction(operand1, operand2,operand3);
Construct
A conditional statement used to trigger structured text code (i.e, other
statements).
Terminate the construct with a semi colon “;”.
IF...THEN
CASE
FOR...DO
WHILE...DO
REPEAT...UNTIL
EXIT
Comment
(see page
page 37)
Text that explains or clarifies what a section of structured text does.
•
Use comments to make it easier to interpret the structured text.
•
Comments do not affect the execution of the structured text.
•
Comments can appear anywhere in structured text.
//comment
(*start of comment . . . end of comment*)
/*start of comment . . . end of comment*/
Term
Definition
Examples
IMPORTANT
Use caution when copying and pasting components between
different versions of the Logix Designer application. The
application only supports pasting to the same version or newer
version. Pasting to a prior version of the application is not
supported. When pasting to a prior version, the paste action
may succeed but the results may not be as intended.