Introduction; Structured Text Syntax - Allen-Bradley Logix5000 Reference Manual

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Introduction

Structured Text Syntax

Term
Definition
Assignment
Use an assignment statement to assign values to tags.
The := operator is the assignment operator.
(see
page
670)
Terminate the assignment with a semi colon ';.'
Expression
An expression is part of a complete assignment or construct statement. An
expression evaluates to a number (numerical expression) or to a true or false
(see
page
673)
state (BOOL expression).
An expression contains:
Tags
Immediate
Operators
Functions
Structured Text Programming
This appendix describes issues that are unique with structured text programming.
Review the information in this appendix to make sure you understand how your
structured text programming executes.
Topic
Structured Text Syntax
Assignments
Expressions
Instructions
Constructs
Comments
Structured text is a textual programming language that uses statements to define
what to execute.
• Structured text is not case sensitive.
• Use tabs and carriage returns (separate lines) to make your structured text
easier to read. They have no effect on the execution of the structured text.
Structured text is not case sensitive. Structured text can contain these
components.
A named area of the memory where data is stored (BOOL,
SINT,INT,DINT, REAL, string).
A constant value.
A symbol or mnemonic that specifies an operation within
an expression.
When executed, a function yields one value. Use
parentheses to contain the operand of a function.
Even though their syntax is similar, functions differ from
instructions in that functions can be used only in
expressions. Instructions cannot be used in expressions.
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Appendix
Page
669
670
673
679
680
696
Examples
tag := expression;
value1
4
tag1 + tag2
tag1 >= value1
function(tag1)
C
669

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents