Rockwell Automation 1775-KA PLC-3 Communication Adapter Module User Manual User Manual

Page 152

Advertising
background image

Network and Application Layer Protocols

Chapter 12

12Ć5

If the network layer of your computer cannot deliver a command to
another station, it writes a local error code into this field to generate a
reply message which it returns to the command indicator in your
application layer. All error codes are listed in appendix B.

TNS

The two TNS (transaction) bytes contain a unique 16–bit transaction
identifier field. A complete transaction consists of a command message
and its corresponding reply message. The TNS value in the reply must be
the same as the TNS value in its associated command. This enables the
command initiator to associate an incoming reply message with one of the
command messages it transmitted previously.

For command messages transmitted by a PC station, the 1775–KA
module assigns the TNS values. For each command message transmitted
by your computer station, your application programs must assign a unique
16–bit transaction number. A simple way to generate the transaction
number is to maintain a 16–bit counter in your application program.
Increment the counter every time your command initiator (application
program) creates a new message, and store the counter value in the two
TNS bytes of the new message.

When your computer program receives a reply to one of its command
messages, it can use the TNS value to tie the reply message to its
corresponding command. If the TNS value of a reply message matches
the TNS value of a command message, then that reply is the appropriate
one for that command.

Whenever your computer network layer receives a command from
another station, it should copy the TNS bytes of the command message
into the same bytes of the corresponding reply message. Do not change
the TNS value in a reply message. If you do, the command initiator will
not be able to match its command to the corresponding reply message.

Note that the low byte (least significant bits) of your TNS value will be
transmitted across the link before the high byte (most significant bits).

At any instant, the combination of SRC, CMD, and TNS values are
sufficient to uniquely identify every message packet in transit for
duplicate message detection. At least one of these fields in the current
message must be different, the command executor ignores the current

Advertising