INTRODUCTION
The DMG series power analyzers and the EXS4... current measuring modules support the modbus
protocol in the variants RTU, ASCII and TCP. The protocols differ mainly in the structure of the
messages, although the information content is equivalent, and in some constraints which make them
suitable for different communication buses.
RTU
Message structure:
Pause
Modbus node
Function
3,5 characters
1 byte
1 byte
Bit timing is critical, therefore the RTU variant is suitable for serial buses (RS485).
ASCII
Message structure:
Character
Modbus node
Function
:
2 chars
2 chars
The beginning and end of a message are marked by specific bytes and there are no time constraints, so
the ASCII variant is suitable for buses with non-deterministic timings (for example, modems).
TCP
Message structure:
Transaction ID
Protocol ID
2 bytes
00 00 (2 bytes)
The messages are marked by an identifier which lets the association between a specific query of the
master and the relevant response of the slave, therefore the TCP variant is suitable for buses in which
the sequence of messages is not guaranteed (ethernet).
MODBUS NODE NUMBER
The modbus node number identifies the device within modbus RTU and ASCII networks, while it is only
an information value (therefore not significant) in modbus TCP networks. Consequently, the power
analyzers behave differently when they receive a message with a modbus node value equal to 0
(broadcast).
•
Modbus RTU: no response, only messages with function 0x06 are processed.
•
Modbus TCP: response provided normally (node 0 is considered a non-significant value, being
considered the IP address to distinguish servers).
•
Modbus TCP/RTU gateway: response normally provided without propagation to the slaves on the
RS485 bus.
PROTOCOL SPECIFICATIONS
•
Byte and word order: big endian (high word first, high byte first), except for CRC which is a little
endian (low byte first) register.
•
A maximum of 120 registers can be contained in the data.
•
Max connection number supported on Modbus TCP: 2 for the built-in communication port
(DMG8000, DMG9000).
•
Supported functions:
Function
Query data content
0x03 (Read holding register)
Address (2 bytes)
0x04 (Read input register)
Register number R (2 bytes)
0x06 (Preset single register)
Address (2 bytes)
Register (2 bytes)
0x10 (Preset multiple
Address (2 bytes)
registers)
Register number R (2 bytes)
Registers (2R bytes)
0x11 (Slave ID)
-
Model code:
DMG7000: 0x70
DMG7500: 0x75
DMG8000: 0x80
DMG9000: 0x90
EXS4...: 0x40
In the event of an error, the reply involves modifying the function code by raising the most significant bit
(for example, if the error occurs with function 0x04, the function code in the response is 0x84) and the
Data
CRC16
2N bytes
2 bytes
Data
CRC16
2N chars
2 chars
Length
Modbus node
Function
2 bytes
1 byte
1 byte
Reply data content
Replied registers byte number (1 byte)
Registers (2R bytes)
Address (2 bytes)
Register (2 bytes)
Address (2 byte)
Writen bytes number
Replied registers byte number (1 byte)
Model code (1 byte)
Firmware revision (1 byte)
Hardware revision (1 byte)
Parameter revision (1 byte)
0x11
0x00
0x00
0x00
POWER ANALYZERS
Modbus manual
ANALIZZATORI DI RETE
Manuale modbus
DMG7000-7500-8000-9000
EXS40000-EXS4001
INTRODUZIONE
Gli analizzatori di rete della serie DMG e i moduli di misura correnti EXS4... supportano il protocollo
modbus nelle tre varianti RTU, ASCII e TCP. I tre protocolli si differenziano principalmente per la struttura
dei messaggi, benché il contenuto informativo sia equivalente, e per alcuni vincoli che li rendono adatti a
diversi bus di comunicazione.
RTU
Struttura messaggio:
Pause
Pausa
Nodo modbus
3,5 characters
3,5 caratteri
La temporizzazione dei bit è fondamentale, perciò la variante RTU è adatta a bus seriali (RS485).
ASCII
Struttura messaggio:
Characters
Carattere
Nodo modbus
CR LF
:
L'inizio e la fine di un messaggio sono scanditi da byte specifici e non ci sono vincoli temporali, dunque la
variante ASCII è adatta a bus con tempistiche non deterministiche (ad esempio modem).
TCP
Struttura messaggio:
Data
ID transazione
ID protocollo
2N bytes
2 byte
00 00 (2 byte)
I messaggi sono marcati da un identificatore che permette l'associazione tra una specifica query del
master e la risposta relativa dello slave, perciò la variante TCP è adatta a bus in cui non è garantita la
sequenza dei messaggi (ethernet).
NUMERO DI NODO MODBUS
Il numero di nodo modbus è identificativo del dispositivo all'interno di reti modbus RTU e ASCII, mentre è
solo una valore informativo (quindi non significativo) nelle reti modbus TCP. Di conseguenza gli
analizzatori di rete si comportano in modo diverso quando ricevono un messaggio con valore nodo
modbus uguale a 0 (broadcast).
•
Modbus RTU: nessuna risposta, vengono processati solo i messaggi con funzione 0x06.
•
Modbus TCP: risposta fornita normalmente (nodo 0 è considerato un non-significant value, essendo
considerato l'indirizzo IP per distinguere i server).
•
Gateway modbus TCP/RTU: risposta fornita normalmente senza propagazione agli slave su bus
RS485.
SPECIFICHE PROTOCOLLO
•
Ordine byte e word: big endian (high word first, high byte first), tranne CRC che è un registro little
endian (low byte first).
•
Nei dati possono essere contenuti al massimo 120 registri.
•
Massimo numero di connessioni supportate su Modbus TCP: 2 per porta di comunicazione integrata
(DMG8000, DMG9000).
•
Funzioni supportate:
Funzione
0x03 (Read holding register)
0x04 (Read input register)
0x06 (Preset single register)
0x10 (Preset multiple
registers)
0x11 (Slave ID)
Codice modello:
DMG7000: 0x70
DMG7500: 0x75
DMG8000: 0x80
DMG9000: 0x90
EXS4...: 0x40
In caso di errore, la replica prevede la modifica del codice funzione alzando il bit più significativo (ad
esempio se l'errore avviene con la funzione 0x04, il codice funzione nella risposta è 0x84) e i dati sono
Funzione
Dati
1 byte
1 byte
2N byte
Funzione
Dati
2 char
2 char
2N char
Lunghezza
Nodo modbus
2 byte
1 byte
Contenuto Dati Query
Contenuto Dati Reply
Indirizzo (2 byte)
Numero byte registri restituiti (1 byte)
Numero registri R (2 byte)
Registri (2R byte)
Indirizzo (2 byte)
Indirizzo (2 byte)
Registro (2 byte)
Registro (2 byte)
Indirizzo (2 byte)
Indirizzo (2 byte)
Numero registri R (2 byte)
Numero byte scritti
Registri (2R byte)
-
Numero byte registri restituiti (1 byte)
Codice modello (1 byte)
Revisione firmware (1 byte)
Revisione hardware (1 byte)
Revisione parametri (1 byte)
0x11
0x00
0x00
0x00
CRC16
Pausa
2 byte
3,5 caratteri
LRC
Caratteri
2 char
CR LF
Funzione
Dati
1 byte
2N byte
Need help?
Do you have a question about the DMG7000 and is the answer not in the manual?
Questions and answers