Specifications

Allen-Bradley ControlLogix Ethernet Driver Help
STRING Value DATA/<Maximum STRING length > MYSTRING.DATA/82
Actual STRING length LEN MYSTRING.LEN
Reads
The STRING read from DATA is terminated by the following:
a. The first null terminator encountered.
b. The value in LEN if a) doesn't occur first.
c. The <Maximum STRING length > if either a) or b) doesn't occur first.
Example
MYSTRING.DATA contains "Hello World" in the PLC, but LEN is manually set to 5. A read of MYSTRING.DATA/82
displays "Hello". If LEN is set to 20, MYSTRING.DATA/82 displays "Hello World".
Writes
When a STRING value is written to DATA, the driver also writes to LEN with the length of DATA written. If the
write to LEN fails for any reason, the write operation to DATA is considered failed as well (despite the fact that the
DATA write to the controller succeeded).
Note: This behavior was designed specifically for Logix tags of type STRING or a custom derivative of it. The
following precautions apply to users who wish to implement their own STRING in UDTs.
l If a UDT exists that has a DATA member referenced as a STRING and a LEN member referenced as a DINT,
the write to LEN succeeds regardless of the intentions of LEN for the given UDT. Care must be taken when
designing UDTs to avoid this possibility if LEN is not intended to be the length of DATA.
l If a UDT exists that has a DATA member referenced as a STRING but does not have a LEN member, the
write to LEN fails silently without consequence to DATA.
Example
MYSTRING.DATA/82 holds the value "Hello World." MYSTRING.LEN holds 11. If the value "Alarm Triggered" is
written to MYSTRING.DATA/82, 15 is written to MYSTRING.LEN. If the write to MYSTRING.LEN fails,
MYSTRING.LEN holds its previous value of 11 while MYSTRING.DATA/82 displays the first 11 characters ("Alarm
Trigg"). If the write to MYSTRING.DATA/82 fails, neither tag is affected.
Automatically Read String Length
In the logical addressing modes, reading STRING.DATA causes an automatic read of STRING.LEN in Symbolic
Mode. This may be bypassed by disabling the "Automatically Read String length" option. For more information,
refer to Logix Options.
Ordering of Logix Array Data
One-Dimensional Arrays - array [dim1]
One-dimensional array data is passed to and from the controller in ascending order.
for (dim1 = 0; dim1 < dim1_max; dim1++)
Example: 3 element array
array [0]
array [1]
array [2]
Two-Dimensional Arrays - array [dim1, dim2]
Two-dimensional array data is passed to and from the controller in ascending order.
for (dim1 = 0; dim1 < dim1_max; dim1++)
for (dim2 = 0; dim2 < dim2_max; dim2++)
Example: 3X3 element array
array [0, 0]
array [0, 1]
array [0, 2]
array [1, 0]
array [1, 1]
array [1, 2]
array [2, 0]
array [2, 1]
array [2, 2]
www. kepware.com
59