Allen-Bradley ControlLogix Ethernet Driver Help
Client/Server Data Type
Client/Server Tag Example
*See Also: Advanced Addressing INT. **See Also: Advanced Addressing DINT. ***See Also: Advanced Addressing REAL.
Addressing Structure Data Types
Only the atomic structure members can be addressed at the structure level. For more information, refer to the examples below.
Logix Tag MyTimer @ TIMER
Client/Server Tag 1. Invalid
TimerTag address = MyTimer TimerTag data type = ??
2. Valid TimerTag address = MyTimer.ACC TimerTag data type = DWord
Addressing STRING Data Type
STRING is a pre-defined Logix data type whose structure contains two members: DATA and LEN. DATA is an array of SINTs and stores the characters of the STRING. LEN is a DINT and represents the number of characters in DATA to display to a client.
Because LEN and DATA are atomic members, they must be referenced independently from a client/server. The syntax is as shown below.
DATA/<Maximum STRING length >
Actual STRING length
Reads The STRING read from DATA will be terminated by the following:
The first null terminator encountered.
The value in LEN if a) doesn't occur first.
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 will display "Hello". If LEN is set to 20, MYSTRING.DATA/82 will display "Hello World".
When a STRING value is written to DATA, the driver will also write to LEN with the length of DATA written. If the write to LEN fails for any reason, the write operation to DATA will be 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.
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 will succeed regardless of the intentions of LEN for the given UDT. Care must be taken