Enter structured text – Rockwell Automation Logix5000 Logix5000 Controllers Quick Start User Manual
Page 84

84
Publication 1756-QS001E-EN-P - October 2009
Chapter 5 Program a Project Offline
Enter Structured Text
Structured text is a textual programming language that uses statements to define what to execute. Structured
text can contain these components.
As you enter structured text, follow these guidelines:
Item
Description
A
Construct defines logical conditions for the execution of other structured text code (other
statements). In this example, the construct is If…Then…Else…End_if.
B
BOOL expression checks if a tag or equation is true or false. A BOOL expression typically
serves as the condition for an action (the if, while, or until of a construct).
C
Assignment writes a value to a tag. The value moves from the right side of the := to the left
side.
D
Numeric expression calculates a value.
E
Semicolon ';' terminates an assignment, instruction, or end of a construct.
Guideline
Description
Structured text is not case sensitive.
Use any combination of upper-case and lower-case letters that makes your text easiest to
read. For example, these three variations of “IF” are the same: IF, If, if.
Use tabs, spaces, and carriage returns
(separate lines) to make your structured
text easier to read.
Tabs, spaces, and carriage returns have no effect on the execution of the structured text.
This
Executes the same as this
If Bool1 then
Bool2 := 1;
End_if;
If Bool1 then Bool2 := 1; End_if;
Bool2 := 1;
Bool2:=1;
A
B
C
D
E