Lovato DMG210 Protocol Instructions Download Page 7

 

 

    Doc. AHIT101C0208.doc                                        Date: 10/11/2009                                                     P.  7 / 18

 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

PROTOCOLLO MODBUS® ASCII   

Il protocollo Modbus® ASCII viene utilizzato 
normalmente nelle applicazioni che richiedono di 
comunicare via modem. 
Le  funzioni e gli indirizzi disponibili sono gli stessi 
della versione RTU, ma i caratteri trasmessi sono in 
ASCII e la terminazione del messaggio non e’ 
effettuata a tempo ma con dei caratteri di ritorno a 
capo. 
Se si seleziona il parametro P7.x.05 o P7.05 o come 
protocollo Modbus® ASCII, la struttura del 

 

messaggio di comunicazione sulla relativa porta di 
comunicazione è così costituita: 
 

 
 

 
Indirizzo 
2 chars 
 

 
Funzione 
2 chars 

 
Dati 
(N chars) 

 
LRC 
2 chars 

 
CR 
LF 

  

 

 Il campo Indirizzo contiene l’indirizzo dello 

strumento slave cui il messaggio viene inviato. 

 Il campo Funzione contiene il codice della funzione 

che deve essere eseguita dallo slave. 

 Il campo Dati contiene i dati inviati allo slave o 

quelli inviati dallo slave come risposta ad una 
domanda. La massima lunghezza consentita e’ di 60 
registri consecutivi. 

 Il campo LRC consente sia al  master che allo 

slave di verificare  se ci sono errori di trasmissione. 
Questo consente, in caso di disturbo sulla linea di 
trasmissione, di ignorare il messaggio inviato per 
evitare problemi sia dal lato master che slave. 

 

Il messaggio termina sempre con i caratteri di 

controllo CRLF (0D 0A). 
 
 

Esempio: 

Per esempio, se si vuole leggere dal DMG con 
indirizzo 8 il valore della corrente di fase  L3 
equivalente che si trova alla locazione 12 (0C Hex), il 
messaggio da spedire è il seguente: 
 

:  08 04 00 0B 00 02 E7 CRLF 

 
Dove: 
:    = ASCII 3Ah = Delimitatore inizio messaggio 
08 = indirizzo slave.

 

04 = funzione di lettura locazione. 
00 0B = indirizzo della locazione diminuito di un’unità, 
contenente il valore della corrente di fase  L3 
00 02 = numero di registri da leggere a partire 
dall’indirizzo 04. 
E7 = checksum LRC. 
CRLF = ASCII 0Dh 0Ah = delimitatore fine 
messaggio 
 
La risposta del DMG è la seguente: 

: 08 04 04 00 00 A8 AE 9B 

CR
LF 

 

Dove: 
:    = ASCII 3Ah = Delimitatore inizio messaggio 
08 = indirizzo dell’ ATL (Slave 08). 
04 = funzione richiesta dal Master. 
04 = numero di byte inviati dallo slave. 
00 00 A8 AE = valore esadecimale della  corrente di 
fase L3  = 4.3182 A. 
9B = checksum LRC. 
CRLF = ASCII 0Dh 0Ah = delimitatore fine 
messaggio 

 
 

 
 

MODBUS® ASCII PROTOCOL 

The Modbus® ASCII protocol is normally used in 
application that require to communicate through a 
couple of modems. 
The functions and addresses available are the same 
as for the RTU version, but the transmitted 
characters are in ASCII and the message end is 
delimited by Carriage return/ Line Feed instead of a 
transmission pause. 
If one selects the parameter P7.x.05 or P7.05 as 
Modbus® ASCII protocol, the communication 
message on the correspondent communication port 
has the following structure: 
 

 
 

 
Address 
(2 chars) 
 

 
Function 
(2 chars) 

 
Dates 
(N chars) 

 
LRC 
(2 
chars) 

 
CR 
LF 

 

 The Address field holds the serial address of the 

slave destination device. 

The Function field holds the code of the function 

that must be executed by the slave. 

 

The Data field

 

contains data sent to the slave or 

data received from the slave in response to a query. 
The maximum allowable length is of 60 consecutive 
registers. 

 The LRC field allows the master and slave 

devices to check the message integrity. If a 
message has been corrupted by electrical noise or 
interference, the LRC field allows the devices to 
recognize the error and thereby ignore the 
message. 

 The message terminates always with CRLF    

control character (0D 0A). 
 

Example: 

For instance, to read the value of the current phase 
L3, which resides at location 12 (0C Hex) from the 
slave with serial address 08, the message to send is 
the following: 
 

:  08 04 00 0B 00 02 E7 CRLF 

 
Whereas: 
:    = ASCII 3Ah message start delimiter 
08 = slave address 
04 = Modbus® function ‘Read input register’ 
00 0B = Address of the required register (L3 current 
phase ) decreased by one 

 

00 02 = Number of registers to be read beginning 
from  address 04 
E7= LRC Checksum 
CRLF = ASCII 0Dh 0Ah = Message end delimiter 

 

The DMG answer is the following: 

: 08 04 04 00 00 A8 AE 9B 

CR
LF 

 
Whereas: 
:    = ASCII 3Ah message start delimiter

 

08 = Multimeter address (Slave 08) 
04 = Function requested by the master 
04 = Number of bytes sent by the multimeter 
00 00 A8 AE = Hex value of the current phase of L3 
(= 4.3182 A.) 
9B = LRC checksum

 

CRLF = ASCII 0Dh 0Ah = Message end delimiter 

Summary of Contents for DMG210

Page 1: ...1C0208 doc Date 10 11 2009 P 1 18 77 DMG210 DMG300 DMG210 DMG300 DMG700 DMG800 DMG700 DMG800 Multimetro digitale Digital multimeter PROTOCOLLO DI COMUNICAZIONE MODBUS COMMUNICATION PROTOCOL MODBUS I302 I GB 1109 ...

Page 2: ...Default P07 x 06 Indirizzo IP 000 000 000 000 255 255 255 255 000 000 000 000 P07 x 07 Subnet MASK 000 000 000 000 255 255 255 255 000 000 000 000 P07 x 08 TCP IP Port 0 9999 1001 MODBUS PROTOCOL The digital multimeter DMG210 supports the communication protocols Modbus RTU and Modbus ASCII on the RS 485 serial port The digital multimeter DMG300 supports the communication protocols Modbus RTU and M...

Page 3: ...4 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 MODBUS RTU PROTOCOL If one selects the Modbus RTU protocol the communication message has the following structure T1 T2 T3 Address 8 bit Function 8 bit Data N x 8 bit CRC 16 bit T1 T2 T3 The Ad...

Page 4: ...pre 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 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 ...

Page 5: ...1 2 3 4 5 6 7 FUNZIONE 17 REPORT SLAVE ID Questa funzione permette di identificare il tipo di multimetro Richiesta Master Indirizzo slave 08h Funzione 11h MSB CRC C6h LSB CRC 7Ch FUNCTION 06 PRESET SINGLE REGISTER This function allows to write in the registers It can be used only with registers with address higher than 1000 Hex For instance it is possible to change setup parameters If the value is...

Page 6: ...5h 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 Typen 82h Data 02 Sw revision 04h Data 03 Hardware revision 00h Data 04 Parameter revision 01h MSB CRC h LSB CRC h n 79h DMG210 82h DMG300 AAh DMG700...

Page 7: ...ta dal Master 04 numero di byte inviati dallo slave 00 00 A8 AE valore esadecimale della corrente di fase L3 4 3182 A 9B checksum LRC CRLF ASCII 0Dh 0Ah delimitatore fine messaggio MODBUS ASCII PROTOCOL The Modbus ASCII protocol is normally used in application that require to communicate through a couple of modems The functions and addresses available are the same as for the RTU version but the tr...

Page 8: ...1110011 1 00000001 Complemento a 2 11110100 Risultato LRC F4 CRC CALCULATION CHECKSUM for RTU Example of CRC calculation Frame 0207h CRC initialization 1111 1111 1111 1111 Load the first byte 0000 0010 Execute xor with the first 1111 1111 1111 1101 Byte of the frame Execute 1st right shift 0111 1111 1111 1110 1 Carry 1 load polynomial 1010 0000 0000 0001 Execute xor with the 1101 1111 1111 1111 po...

Page 9: ...r VA 100 Unsigned long 0026H 2 Fattore Di Potenza L1 L1 Power Factor 10000 Signed long 0028H 2 Fattore Di Potenza L2 L2 Power Factor 10000 Signed long 002AH 2 Fattore Di Potenza L3 L3 Power Factor 10000 Signed long 0032H 2 Frequenza Frequency Hz 100 210 Hz 1000 300 Hz 1000 700 Hz 1000 800 Unsigned long 0034H 2 Tensione Di Fase Equivalente Eqv Phase Voltage V 100 Unsigned long 0036H 2 Tensione Di L...

Page 10: ... Voltage Unsigned long 0C02H 2 3 Armonica Tensione L1 3 Harmonic L1 Voltage Unsigned long 0C3AH 2 31 Armonica Tensione L1 31 Harmonic L1 Voltage Unsigned long 0C40H 2 2 Armonica Tensione L2 2 Harmonic L2 Voltage Unsigned long 0C7AH 2 31 Armonica Tensione L2 31 Harmonic L2 Voltage Unsigned long 0C80H 2 2 Armonica Tensione L3 2 Harmonic L3 Voltage Unsigned long 0CBAH 2 31 Armonica Tensione L3 31 Har...

Page 11: ...h 100 Unsigned long 1A32H 2 Energia apparente parziale Apparent Energy Par KVAh 100 Unsigned long 1B4AH 2 Tariffa A Energia Attiva Importata Active Energy Imp Tariff A kWh 100 Unsigned long 1B4EH 2 Tariffa A Energia Attiva Esportata Active Energy Exp Tariff A kWh 100 Unsigned long 1B52H 2 Tariffa A Energia Reattiva Importata Reactive Energy Imp Tariff A kVarh 100 Unsigned long 1B56H 2 Tariffa A En...

Page 12: ...nsigned long 2100H 1 OR di tutti gli ingressi OR of all Inputs n Unsigned int 2101H 1 Ingresso 1 Input 1 bool Unsigned int 2108H 1 Ingresso 8 Input 8 bool Unsigned int 2110H 1 OR di tutte le uscite OR of all Outputs n Unsigned int 2111H 1 Uscite 1 Output 1 bool Unsigned int 2118H 1 Uscite 8 Output 8 bool Unsigned int 2120H 1 OR di tutti gli allarmi OR of all Alarms n Unsigned int 2121H 1 Allarme 1...

Page 13: ...ito Inverted TA3 11 CT1 su fase L2 TA1 on phase L2 12 CT1 su fase L3 TA1 on phase L3 13 CT2 su fase L1 TA2 on phase L1 14 CT2 su fase L3 TA2 on phase L3 15 CT3 su fase L1 TA3 on phase L1 16 CT3 su fase L2 TA3 on phase L1 INDIRIZZO ADDRESS WORDS COMANDO COMMAND VALORE VALUE FORMATO FORMAT DMG 210 DMG 300 DMG 700 DMG 800 2FF0H 1 Azzera HI LOW Reset HIGH LOW 0 Unsigned int 2FF0H 1 Azzera Max Demand R...

Page 14: ... Pagina di default Default page 1 32 1 1 508CH P02 08 Sotto pagina di default Default sub page 0 13 0 1 508EH P02 09 Tempo di aggiornamento display Display update time 1 50 5 1 5090H M03 Password Password P03 01 Abilitazione password Enable passwords 0 1 0 1 5100H P03 02 Password livello utente User level Password 0 9999 1000 1 5102H P03 03 Password livello avanzato Advanced level Password 0 9999 ...

Page 15: ...0H P09 n 02 Numero canale x Channel number x 1 8 1 1 n5802H n 1 80H P09 n 03 Memoria Latch 0 1 0 1 n5804H n 1 80H P09 n 04 Priorità Priority 0 1 0 1 n5806H n 1 80H P09 n 05 Testo Text ALAn 8 n5808H n 1 80H M10 Contatori Counters P10 n 01 Sorgente conteggio Counter source 0 4 0 1 n5C00H n 1 80H P10 n 02 Numero canale x Channel number x 1 8 1 1 n5C02H n 1 80H P10 n 03 Moltiplicatore Multiplier 1 100...

Page 16: ... Outputs P14 n 01 Funzione uscita Output function 0 7 0 1 n6880H n 1 80H P14 n 02 Numero canale x Channel number x 1 8 1 1 n6882H n 1 80H P14 n 03 Stato a riposo Idle status 0 1 0 1 n6884H n 1 80H M15 Pagina Utente Users Pages P15 n 01 Abilitazione Page enabling 0 1 0 1 n6C80H n 1 80H P15 n 02 Titolo Title PAGn 8 n6C82H n 1 80H P15 n 03 Misura 1 Measurement 1 0 47 0 1 n6C8AH n 1 80H P15 n 04 Misur...

Page 17: ...XP 10 13 Ethernet Per questi moduli utilizzare un cavo standard EXM 10 10 USB EXM 10 13 Ethernet EXP 10 10 USB EXP 10 13 Ethernet For this modules use a standard cable EXM 10 11 DEVICE 1 30 L MAX 1200mt DEVICE 31 60 L MAX 1200mt EXM10 SET AS REPEATER EIA 232 EIA 485 422 TR B TR A SG CH2 A B SG CH1 PX1 SG TR B A EXM10 A1 A1 A2 A2 EXM10 SG TR A B EXM10 EIA 232 A1 A1 A2 A2 PC RS232 RS232 RS485 CONV E...

Page 18: ...Doc AHIT101C0208 doc Date 10 11 2009 P 18 18 EXP 10 11 RS 232 EXP 10 12 RS 485 RS232 PC Cable 51C2 RJ6 6 TR A B SG EXP10 12 n 1 EXP10 12 n 31 SG TR B A RS485 TR B A SG RS485 PX1 A TR B SG PC ...

Reviews: