Structured Text Programming
512 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018
Component Description
tag Represents the tag that is getting the new value; the tag must be a BOOL, SINT, INT,
DINT, STRING, or REAL.
Tip: The STRING tag is applicable toCompactLogix 5380, CompactLogix 5480,
ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers
only.
[:=] Is the non-retentive 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
SINT Numeric
INT
DINT
REAL
STRING
(CompactLogix 5380, CompactLogix
5480, ControlLogix 5580, Compact
GuardLogix 5380, and GuardLogix 5580
controllers only).
String type, including string tag and string
literal
CompactLogix 5380, CompactLogix 5480,
ControlLogix 5580, Compact GuardLogix
5380, and GuardLogix 5580 controllers(
only)
See also
Assign an ASCII character to a string data member on page 512
Structured Text Components: Assignments on page 510
Assign an ASCII character to a string data member
Use the assignment operator to assign an ASCII character to an element of the
DATA member of a string tag. To assign a character, specify the value of the
character or specify the tag name, DATA member, and element of the character.
For example:
This is OK This is not OK
string1.DATA[0] := 65; string1.DATA[0] := A;
string1.DATA[0]:= string2.DATA[0]; string1 := string2;
Tip: This assigns all content of string2 to string1
instead of just one character.
Assign an ASCII character
to a string data member