Rockwell-automation 1770, D17706.5.16 Ref Mnl DF1 Protocol Command Manual de usuario Pagina 41

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 251
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 40
3–4 Using Half-duplex Protocols to Send and Receive Messages
Publication
17706.5.16 - October 1996
The following program describes the actions of the transceiver in
detail:
TRANSCEIVER
is defined
variables
LAST
-HEADER is 4 bytes copied out of the last good message
BCC is an 8-bit block check accumulator
LAST-HEADER = invalid
loop
reset parity error flag
GET-CODE
if it’
s a DLE SOH then
begin
GET-CODE
if it’
s a data code and it matches the station number or it
is 255 (the broadcast address) then
begin
BCC = the data code
GET-CODE
if it’
s a DLE STX then
begin
RESPONSE = GETMESSAGE
if RESPONSE is ACK then
begin
if message header is dif
ferent from
last and sink is not full
begin
save new HEADER
try to send message to sink
end
if this is not a broadcast message
and sink was not full then
begin
turn on R
TS
wait for CTS
send DLE ACK
turn of
f RTS
end
end
end
end
end
else if it’
s a DLE ENQ then
begin
GET
-CODE (the station number)
GET-CHAR (the BCC)
check the station number and the BCC, and if they’re OK then
begin
if there is a message left over from the last time and
the transmit counter is exceeded then
throw the message away and send an error code to the
message source
if there is no message then
try to get one from the message source
turn on R
TS
wait for CTS
if there is still no message then send a DLE EOT
else SEND the message
turn of
f RTS
end
end
else if it’
s a DLE ACK then
send a success code to the message source and discard the
message
else if it’
s a DLE NAK then
while the message source can supply a message
begin
get a message from the message source
discard the message
send an error code to the message source
end
end
Vista de pagina 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 250 251

Comentarios a estos manuales

Sin comentarios