Rockwell-automation 1770-KF2 Data Highway or Highway Plus Interface Mo Manual de usuario Pagina 58

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 235
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 57
Asynchronous Link Protocols
Chapter 4
4-15
T
able 4.B
Receiver
for Full-Duplex Protocol
RECEIVER
is defined as
variables
LAST
-HEADER is 4 bytes copied out of the last good message
RESPONSE is the value of the last ACK or NAK sent
BCC is an 8-bit block check accumulator
LAST
-HEADER = Invalid
LAST
-RESPONSE = NAK
loop
reset parity error flag
GET-CODE
if DLE STX then
begin
BCC = 0
GET-CODE
while it is a data code
begin
if buf
fer is not overflowed put data in buf
fer
GET-CODE
end
if the control code is not a DLE ETX then send DLE NAK
else if error flag is set then send DLE NAK
else if BCC is not zero then send DLE NAK
else if message is too small then send DLE NAK
else if message is too large then send DLE NAK
else if header is same as last message send a DLE ACK
else if message sink is full send DLE NAK
else
begin
send message to message sink
send a DLE ACK
save last header
end
end
else if DLE ENQ then send LAST
-RESPONSE
else LAST
-RESPONSE = NAK
end loop
GET
-CODE is defined as
loop
GET-CHAR
if char is not a DLE
begin
add char to BCC
return the char and data flag
end
else
begin
GET-CHAR
if char is a DLE
begin
add char to BCC
return a DLE and a data flag
end
else if char is an ACK or NAK send it to the transmitter
else if char is an ETX
begin
GET-CHAR
add char to BCC
return ETX with a control flag
end
else return character with a control flag
end
end loop
GET
-CHAR is defined as
an implementation-dependent function that returns one byte of data from the link interface hardware.
Vista de pagina 57
1 2 ... 53 54 55 56 57 58 59 60 61 62 63 ... 234 235

Comentarios a estos manuales

Sin comentarios