1 - program structured text, Introduction, Chapter 1 – Rockwell Automation Logix5000 Controllers Structured Text Programming Manual User Manual

Page 9: Program structured text, Chapter

Advertising
background image

Publication 1756-PM007D-EN-P - November 2012

9

Chapter

1

Program Structured Text

Introduction

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:

Term

Definition

Examples

Assignment

(see page 11)

Use an assignment statement to assign values to tags.

The

:=

operator is the assignment operator.

Terminate the assignment with a semi colon “;”.

tag := expression;

Expression

(see page 13)

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 state (BOOL expression).

An expression contains:

Tags

A named area of the memory where data is stored
(BOOL, SINT,INT,DINT, REAL, string).

value1

Immediates

A constant value.

4

Operators

A symbol or mnemonic that specifies an operation
within an expression.

tag1 + tag2

tag1 >= value1

Functions

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 only be used
in expressions. Instructions cannot be used in
expressions.

function(tag1)

Advertising