Asynchronous link protocols chapter 4 – Rockwell Automation 1770-KF2 Data Highway or Highway Plus Interface Module User Manual User Manual

Page 55

Advertising
background image

Asynchronous Link Protocols

Chapter 4

4-12

Table 4.A
Transmitter for Full-Duplex Protocol

TRANSMITTER is defined as

loop

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

end loop

TRANSFER (Message) is defined as

initialize NAK-limit and ENQ-limit
SEND (Message)
start timeout
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 retries;
SEND-MESSAGE (Message);
start timeout

end
end

else if timeout

if ENQ-limit is exceeded then return FAILURE
else

begin

count ENQ retries;
send DLE ENQ on Path 1;
start timeout

end
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 code 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.

Advertising