
Define a structured text routine Chapter 11
Rockwell Automation Publication 1756-RM084S-EN-P - March 2015 207
Term Definition Examples
Construct A conditional statement used to trigger structured text code.
Terminate the construct with a semi colon ";".
IF...THEN
CASE
FOR...DO
WHILE...DO
REPEAT...UNTIL
EXIT
Comment 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*/
If you export structured text logic that contains online edits, the export file
exports LOGIC blocks (in L5K format) or additional <STContent> elements (in
L5X format) to indicate the original test edits and pending edits states. If there are
no online edits, you will not see these LOGIC blocks or additional <STContent>
elements.
Item Identifies
Online_Edit_Type When you export the logic:
• If online edits exist, there is a LOGIC block for Online_Edit_Type := Orig and the appropriate LOGIC block for the existing edits.
Online_Edit_Type : = Pend indicates pending edits. Online_Edit_Type := Test indicates test edits.
• If there are no online edits when you export the logic, there are no LOGIC blocks and the main components in the routine are structured text
statements.
L5X example: test edits and pending edits exist
L5K Example 1: Test edits and pending edits exist
ST_ROUTINE MySTRoutine
LOGIC (Online_Edit_Type := Orig)
Export structured text logic
while editing online
Examples