
DN120 DeviceNet Gateway User’s Manual
Microscan Systems, Inc.
16
Synchronous Handshake Protocol
The gateway can be configured with a more robust transmit and receive synchronization process.
The Handshake protocol requires the user application to acknowledge the receipt of new
RX
Message
input bytes. The protocol also requires the gateway to acknowledge the transmission of
the last
TX Message
output bytes. When enabled, both the
Receive Sequence Number
input byte
and
Transmit Sequence Number
output byte are used. They are segmented into four 4-bit
numbers, shown below. Valid numbers are 1 to 15, with 0 reserved to reset the gateway’s
numbers.
The
Receive Request Number
is incremented by the gateway when it returns new
RX Message
input bytes in the Poll Response Message. The gateway will increment from 15 to 1, skipping 0.
The user application acknowledges receipt of this
RX Message
by setting the
Receive
Acknowledge Number
equal to the
Receive Request
Number
. The updated
Receive Acknowledge
Number
is sent back to the gateway in the next Poll Command Message. When the
Receive
Acknowledge Number
equals the
Receive Request
Number
, the gateway can return the next set of
RX Message
. If the user application sends 0 as the
Receive Acknowledge Number
, the gateway
resets its
Receive Request Number
to 0.
The following ladder-logic rung shows how the user application program can monitor the
gateway’s
Receive Request Number
(RX Rqst Num), save the new
RX Message
bytes, and set
Receive Acknowledge
Number
(RX Ack Num) equal to
Receive Request Number
(RX Rqst
Num).
Receive Acknowledge Number
Transmit Request Number
Transmit Sequence Number byte
Bits 4-7 (upper nibble)
Bits 0-3 (lower nibble)
Receive Request Number
Transmit Acknowledge Number
Receive Sequence Number byte
Bits 4-7 (upper nibble)
Bits 0-3 (lower nibble)
Compare Function:
RX Rqst Num <> RX Ack Num
Copy Function:
<byte array> = RX Message
Copy Function:
RX Ack Num = RX Rqst Num
Did gateway increment the RX Rqst
Num, indicating new data?
Save the RX Message bytes.
Acknowledge receipt of new data.