Assignments – Rockwell Automation Logix5000 Controllers Structured Text Programming Manual User Manual

Page 11

Advertising
background image

Publication 1756-PM007D-EN-P - November 2012

11

Program Structured Text Chapter 1

Assignments

Use an assignment to change the value stored within a tag. An assignment has
this syntax:

tag := expression ;

where:

The tag retains the assigned value until another assignment changes the value.

The expression can be simple, such as an immediate value or another tag
name, or the expression can be complex and include several operators and/or
functions.

Component

Description

tag

Represents the tag that is getting the new value.

The tag must be a BOOL, SINT, INT, DINT, or REAL.

:=

Is the assignment symbol.

expression

Represents the new value to assign to the tag.

If tag is this data type

Use this type of expression

BOOL

BOOL expression

SINT

INT

DINT

REAL

Numeric expression

;

Ends the assignment.

TIP

I/O module data updates asynchronously to the execution of
logic. If you reference an input multiple times in your logic,
the input could change state between separate references. If
you need the input to have the same state for each reference,
buffer the input value and reference that buffer tag.

Advertising