Rockwell-automation 1770, D17706.5.16 Ref Mnl DF1 Protocol Command Manuel d'utilisateur Page 42

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 251
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 41
3–5Using Half-duplex Protocols to Send and Receive Messages
Publication
17706.5.16 - October 1996
GETMESSAGE
is defined as
GET-CODE
while it is data code
begin
if buf
fer is not overflowed put data in buf
fer
GET-CODE
end
if it is a control code and it is an ETX then
begin
if parity error flag is set then return a NAK
if BCC is not zero then return a NAK
if message is too small then return a NAK
if message is too large then return a NAK
return an ACK
end
else end
GET-CODE is defined as
loop
variable
GET-CHAR
if char is not a DLE
begin
add char to BCC
return the char and a 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 ETX
begin
GET-CHAR
add char to BCC
return ETX with a control flag
end
else return char with a control flag
end
end
end
GETCHAR is defined as
an implementationdependent function that returns one byte of data
from the link interface hardware
SEND (Message) is defined as
begin
BCC = 0
send DLE STX
for every byte in the message do
begin
subtract the byte from the BCC
send the corresponding data code
end
send DLE ETX BCC
end
Vue de la page 41
1 2 ... 37 38 39 40 41 42 43 44 45 46 47 ... 250 251

Commentaires sur ces manuels

Pas de commentaire