How the transmitter operates – Rockwell Automation 1770, D17706.5.16 Ref Mnl DF1 Protocol Command User Manual

Page 59

Advertising
background image

4–5

Using Full-duplex Protocol to Send and Receive Messages

Publication 1770Ć6.5.16 - October 1996

How the Transmitter Operates

The following program describes the actions of the transmitter:

TRANSMITTER is defined as

loop

Message=GET-MESSAGE-TO-SEND
Status=TRANSFER(Message)

SIGNAL-RESULTS(Status)

end loop

loop
WAIT for response on path 2 or timeout.
if received DLE ACK then return SUCCESS
else if received DLE NAK then

if nak-limit is exceeded then return FAILURE
else

begin

count NAK re-tries;
SEND-MESSAGE(message);
start timeout

end

else if timeout

if enq-limit is exceeded then return FAILURE

else

begin

count ENQ re-tries;
send DLE ENQ on path 1;
start timeout

end

end loop

SEND (message) is defined as

begin

BCC = 0
send DLE STX on path 1
for every byte in the message do

begin

add the byte to the BCC;
send the corresponding data symbol

on

path 1

end

send DLE ETX BCC on path 1

end

GET-MESSAGE-TO-SEND

This is an operating-system-dependent interface
routine that waits and allows the rest of the
system to run until the message source has supplied
a message to be sent.

SIGNAL-RESULTS

This is an implementation-dependent routine that
tells the message source of the results of the
attempted message transfer.

WAIT

This is an operating-system-dependent routine
that waits for any of several events to occur
while allowing other parts of the system to run.

TRANSFER (Message) is defined as

initialize nak-limit and enq-limit
SEND(Message)

start timeout

Whenever the message source can supply a message packet and the

transmitter is not busy, it sends a frame on the link to the destination

address. It then starts a timeout, and waits for a response.
When this response is

The message packet

received from the receiving

address
DLE ACK

has been successfully transferred.

After signaling the message

source that the message packet

was successfully transmitted, the

transmitter proceeds with the next

message packet.

DLE NAK

is retransmitted. The transmitter

restarts the timeout

and waits

again for a response. If it receives

a DLE ACK, the transmitter starts

a timeout.
This can be repeated several

times. You can set a limit to the

number of times a message can

be reĆtransmitted for each module.

If this limit is exceeded, the

message source is informed of the

failure and the transmitter

proceeds with the next message.

If the timeout expires before a response is received, the transmitter sends

a DLE ENQ to request a retransmission of the last response. It restarts

the timeout and waits for a response.
You can also set a limit to the number of timeouts that are allowed per

message. If the enquiry (ENQ) limit is exceeded, the transmitter signals

the message source that the transmission has failed, and the transmitter

proceeds to the next message.
There are three responses defined: DLE ACK, DLE NAK, DLE ENQ,

If the transmitter receives an different response, the transmitter ignores it.

Advertising