Rockwell Automation 1770-KF2 Data Highway or Highway Plus Interface Module User Manual User Manual

Page 85

Advertising
background image

Message Packet Formats

Chapter 5

5-6

TNS

A complete transaction consists of a command message transmitted by a
PC station. The TNS (transaction) bytes contain a a unique 16-bit
transaction identifier. The first byte, RNG, contains the number of the PC
program rung that generated the command; and the second, SQN, contains
the transmission sequence number. For command messages transmitted
by your computer station, your application programs can use the RNG and
SQN bytes together to store a single 16-bit transaction number.

For command messages transmitted by a PC station, the station interface
module assigns the TNS values. For each command message transmitted
by your computer station, your network level software must assign a
unique 16-bit transaction number; and a simple way to generate this
number is to maintain a 16-bit counter at the network layer. 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 the command initiator receives a reply to one of its command
messages, it can use the RNG and SQN bytes to tie the reply message to
its corresponding command. If the RNG and SQN bytes of a reply
message match the RNG and SQN bytes of a command message, then that
reply is the appropriate one for that command.

Whenever the command executor receives a command from another
station, it should copy the RNG and SQN fields of the command message
into the same fields of the corresponding reply message. Do not change
the RNG and SQN values 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, RNG, and SQN are
sufficient to uniquely identify every message packet in transit. At least
one of these fields in the current message must be different than the
corresponding field in the last message received by a command executor.
If none of these fields is different, the command executor ignores the
currently received message. This process is called duplicate message
detection.

Advertising