EasyManua.ls Logo

Lovato DME CD - Modbus Function 16 and Error Handling; Preset Multiple Registers and Error Codes

Default Icon
18 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Doc. AHIT101A0510.doc 10/02/2011 P. 6 / 18
Risposta Slave:
Indirizzo slave 08h
Funzione 11h
Contatore bytes 04 h
Dato 1 (Tipo) C8h
Dato 2 (Revisione software) 04h
Dato 3 (Revisione hardware) 00h
Dato 4 (Revisione parametri) 01h
MSB CRC …h
LSB CRC …h
ERRORI
Nel caso lo slave riceva un messaggio errato,
segnala la condizione al master rispondendo con un
messaggio composto dalla funzione richiesta in OR
con 80 Hex, seguita da un codice di errore.
Nella seguente tabella vengono riportati i codici di
errore inviati dallo slave al master:
TABELLA 1: CODICI ERRORE
COD ERRORE
01 Funzione non valida
02 Indirizzo registro illegale
03 Valore del parametro fuori range
04 Impossibile effettuare operazione
06
Slave occupato, funzione
momentaneamente non disponibile
FUNZIONE 16: PRESET MULTIPLE REGISTER
Questa funzione permette di modificare più parametri
consecutivamente o parametri composti da più di 2
byte. L’indirizzo ed il range valido per i vari parametri
possono essere trovati nella Tabella 8.
Richiesta Master:
Indirizzo slave 08h
Funzione 10h
MSB Indirizzo registro 20h
LSB Indirizzo registro 01h
MSB Numero registri 00h
LSB Numero registri 02h
MSB Dato 00h
LSB Dato 00h
MSB Dato 00h
LSB Dato 00h
MSB CRC 85h
LSB CRC 3Eh
Risposta Slave:
Indirizzo slave 08h
Funzione 10h
MSB Indirizzo registro 20h
LSB Indirizzo registro 01h
MSB Numero byte 00h
LSB Numero byte 02h
MSB CRC 1Bh
LSB CRC 51h
Slave response:
Slave address 08h
Function 11h
Byte count 04 h
Data 01 –Type C8h
Data 02 – (Sw revision) 04h
Data 03 – (Hardware revision) 00h
Data 04 – (Parameter revision) 01h
MSB CRC …h
LSB CRC …h
ERRORS
In case the slave receives an incorrect message, it
answers with a massage composed by the queried
function ORed with 80 Hex, followed by an error
code byte.
In the following table are reported the error codes
sent by the slave to the master:
TABLE 1: ERROR CODES
CODE ERROR
01 Invalid function
02 Invalid address
03 Parameter out of range
04 Function execution impossible
06
Slave busy, function momentarily not
available
FUNZIONE 16: PRESET MULTIPLE REGISTER
This function allows to modify multiple parameters
with a single message, or to preset a value longer
than one register. The address and the valid range
for each parameter are stated in Table 8.
Master message:
Slave address 08h
Function 10h
MSB register address 20h
LSB register address 01h
MSB register number 00h
LSB register number 02h
MSB data 00h
LSB data 00h
MSB data 00h
LSB data 00h
MSB CRC 85h
LSB CRC 3Eh
Slave response:
Slave address 08h
Function 10h
MSB register address 20h
LSB register address 01h
MSB byte number 00h
LSB byte number 02h
MSB CRC 1Bh
LSB CRC 51h