X hits on this document

497 views

0 shares

4 downloads

0 comments

58 / 133

Allen-Bradley ControlLogix Ethernet Driver Help

58

Float

Float

Float Array

REALTAG

REALARR[0]

REALARR[0]{4}

REAL

Client/Server Data Type

Advanced

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.

Description

Syntax

Example

STRING Value

DATA/<Maximum STRING length >

MYSTRING.DATA/82

Actual STRING length

LEN

MYSTRING.LEN

Reads The STRING read from DATA will be 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 will display "Hello". If LEN is set to 20, MYSTRING.DATA/82 will display "Hello World".

Writes

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.

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 will succeed regardless of the intentions of LEN for the given UDT. Care must be taken

www. kepware.com

Document info
Document views497
Page views519
Page last viewedMon Dec 05 12:29:05 UTC 2016
Pages133
Paragraphs5515
Words40931

Comments