
Doc. I317IGB12_19.doc 18/12/2019 P. 4 / 41
La risposta del DMG è la seguente:
01 04 04 00 01 FB 00 E9 74
Dove:
01= indirizzo del DMG (Slave 01)
04 = funzione richiesta dal Master
04 = numero di byte inviati dal DMG
00 01 FB 00 = valore esadecimale potenza attiva L2
= 129792 = 1.29792 KW
E9 74 = checksum CRC
FUNZIONE 04: READ INPUT REGISTER
La funzione 04 permette di leggere una o più
grandezze consecutive in memoria. L’indirizzo di
ciascuna grandezza e’ indicato nelle Tabelle 2-4
riportate nelle ultime pagine del presente manuale.
Come da standard Modbus®, l’indirizzo specificato
nel messaggio va diminuito di 1 rispetto a quello
effettivo riportato nella tabella.
Se l’indirizzo richiesto non è compreso nella tabella o
il numero di registri richiesti è maggiore del numero
consentito il DMG ritorna un messaggio di errore (
vedi tabella errori).
Richiesta Master:
Indirizzo slave
08h
Funzione 04h
MSB Indirizzo registro
00h
LSB Indirizzo registro
0Fh
MSB Numero registri
00h
LSB Numero registri
08h
LSB CRC
C1h
MSB CRC
56h
Nell’esempio vengono richiesti ,allo slave numero 8,
8 registri consecutivi a partire dall’indirizzo 10h.
Quindi vengono letti i registri dall’ 10h al 17h.
Il comando termina sempre con il valore di checksum
CRC.
Risposta Slave:
Indirizzo slave
08h
Funzione 04h
Numero di byte
10h
MSB Dato 10h
00h
LSB Dato 10h
00h
--------------------------------------------------- ----
MSB Dato 17h
00h
LSB Dato 17h
00h
LSB CRC
5Eh
MSB CRC
83h
La risposta è composta sempre dall’indirizzo dello
slave, dalla funzione richiesta dal Master e dai dati
dei registri richiesti. La risposta termina sempre con il
valore di checksum CRC.
The DMG answer is the following:
01
04
04 00 01 FB 00
E9 74
Where:
01 = DMG address (Slave 01)
04 = Function requested by the master
04 = Number of bytes sent by the DMG
00 01 FB 00 = Hex value of the active power
L2=129792 = 1.29792 KW
E9 74 = CRC checksum
FUNCTION 04: READ INPUT REGISTER
The Modbus® function 04 allows to read one or
more consecutive registers from the slave memory.
The address of each measure is given in the tables
2-4 on the final pages of this manual.
As for Modbus® standard, the address in the query
message must be decreased by one from the
effective address reported in the table.
If the measure address is not included in the table
or the number of requested registers exceeds the
acceptable max number, the DMG will return an
error code (see error table).
Master query:
Slave address
08h
Function 04h
MSB address
00h
LSB address
0Fh
MSB register number
00h
LSB register number
08h
LSB CRC
C1h
MSB CRC
56h
In the above example, slave 08 is requested for 8
consecutive registers beginning with address 10h.
Thus, registers from 10h to 17h will be returned. As
usual, the message ends with the CRC checksum.
Slave response:
Slave address
08h
Function 04h
Byte number
10h
MSB register 10h
00h
LSB register 10h
00h
--------------------------------------------------- ----
MSB register 17h
00h
LSB register 17h
00h
LSB CRC
5Eh
MSB CRC
83h
The response is always composed of the slave
address, the function code requested by the master
and the contents of the requested registers. The
answer ends with the CRC.