Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
I dispositivi di controllo dei gruppi elettrogeni della The LEXYS series of generating set controller
serie LEXYS supportano i protocolli di comunicazione support the communication protocols Modbus
Modbus RTU® , Modbus ASCII® e Modbus TCP® RTU®, Modbus ASCII®, ModbusTCP® on the RS-
sulle porte seriali RS-232 e interfaccia ottica. 232 and optical interface.
I dispositivi di controllo dei gruppi elettrogeni della The LEXYS ADV series of generating set controller
serie LEXYS ADV supportano i protocolli di support the communication protocols
comunicazione Modbus RTU® , Modbus ASCII® e Modbus RTU® , Modbus ASCII®, ModbusTCP® on
Modbus TCP® sulle porte seriali RS-485, interfaccia the RS-485, optical interface and the expansion
ottica e sui moduli di espansione: modules.
· EXM 10 11 RS 232 · EXM 10 11 RS 232
· EXM 10 12 RS485 · EXM 10 12 RS485
· EXM 10 20 RS 485 + 2 relè · EXM 10 20 RS 485 + 2 relè
· EXM 10 10 USB · EXM 10 10 USB
· EXM 10 13 Ethernet · EXM 10 13 Ethernet
Grazie a questa funzione e’ possibile leggere lo stato Using this function it is possible to read the device
degli apparecchi e controllare gli stessi tramite status and to control the units through third-party
software di supervisione standard forniti da terze parti supervision software (SCADA) or through other
(SCADA) oppure tramite apparecchiature dotate di intelligent devices supporting Modbus®, like PLCs.
interfaccia Modbus® quali PLC e terminali intelligenti.
· Il campo Indirizzo contiene l’indirizzo dello · The Address field holds the serial address of the
strumento slave cui il messaggio viene inviato. slave destination device.
· Il campo Funzione contiene il codice della funzione ·The Function field holds the code of the function
che deve essere eseguita dallo slave. that must be executed by the slave.
· Il campo Dati contiene i dati inviati allo slave o · The Data field contains data sent to the slave or
quelli inviati dallo slave come risposta ad una data received from the slave in response to a query.
domanda. · For the LEXYS series, the maximum length for the
· Per la serie LEXYS la lunghezza massima data field is 80 16-bit registers (160 bytes)
consentita per il campo dati e’ di 80 registri da 16 bit
(160 bytes) · The CRC field allows the master and slave
devices to check the message integrity. If a
· Il campo CRC consente sia al master che allo slave message has been corrupted by electrical noise or
di verificare se ci sono errori di trasmissione. interference, the CRC field allows the devices to
Questo consente, in caso di disturbo sulla linea di recognize the error and thereby to ignore the
trasmissione, di ignorare il messaggio inviato per message.
evitare problemi sia dal lato master che slave. · The T1 T2 T3 sequence corresponds to a time in
which data must not be exchanged on the
· La sequenza T1 T2 T3 corrisponde al tempo communication bus to allow the connected devices
durante il quale non devono essere scambiati dati sul to recognize the end of one message and the
bus di comunicazione, per consentire agli strumenti beginning of another. This time must be at least 3.5
collegati di riconoscere la fine di un messaggio e times the time required to send one character.
l’inizio del successivo. Questo tempo deve essere
pari a 3.5 caratteri. The LEXYS measures the time that elapses from
the reception of one character and the following. If
La LEXYS misura il tempo trascorso tra la ricezione this time exceeds the time necessary to send 3.5
di un carattere e il successivo e se questo tempo characters at the selected baudrate, then the next
supera quello necessario per trasmettere 3.5 character will be considered as the first of a new
caratteri, riferiti al baud rate impostato, il prossimo message.
carattere viene considerato l’inizio di un nuovo
messaggio.
Per esempio, se si vuole leggere dalla Lexys con For instance, to read the value of active power of
indirizzo 01 il valore della potenza attiva L2 di rete line L2 of mains , which resides at location 36 (24
che si trova alla locazione 36 (24 Hex), il messaggio Hex), from the LEXYS with serial address 01, the
da spedire è il seguente: message to send is the following:
01 04 00 23 00 02 80 01 01 04 00 23 00 02 80 01
Dove: Whereas:
01= indirizzo slave 01= slave address
04 = funzione di lettura locazione 04 = Modbus® function ‘Read input register’
00 23 = indirizzo della locazione diminuito di 00 23 = Address of the required register (active
un’unità, contenete il valore della potenza attiva L2 power of L2 of mains) decreased by one
rete 00 02 = Number of registers to be read beginning
00 02 = numero di registri da leggere a partire from address 22
dall’indirizzo 22 80 01 = CRC Checksum
80 01 = checksum CRC
Dove: Where:
01= indirizzo della Lexys (Slave 01) 01 = LEXYS AMF address (Slave 01)
04 = funzione richiesta dal Master 04 = Function requested by the master
04 = numero di byte inviati dalla Lexys 04 = Number of bytes sent by the LEXYS
FUNZIONE 04: READ INPUT REGISTER FUNCTION 04: READ INPUT REGISTER
La funzione 04 permette di leggere una o più The Modbus® function 04 allows to read one or
grandezze consecutive in memoria. L’indirizzo di more consecutive registers from the slave memory.
ciascuna grandezza e’ indicato nella Tabella 2 The address of each measure is given in the table 2
riportate nelle ultime pagine del presente manuale. on the final pages of this manual.
Come da standard Modbus®, l’indirizzo specificato As for Modbus® standard, the address in the query
nel messaggio va diminuito di 1 rispetto a quello message must be decreased by one from the
effettivo riportato nella tabella. effective address reported in the table.
Se l’indirizzo richiesto non è compreso nella tabella o If the measure address is not included in the table
il numero di registri richiesti è maggiore del numero or the number of requested registers exceeds the
consentito LEXYS ritorna un messaggio di errore ( acceptable max number, the LEXYS will return an
vedi tabella errori). error code (see error table).
La risposta è composta sempre dall’indirizzo dello The response is always composed of the slave
slave, dalla funzione richiesta dal Master e dai dati address, the function code requested by the master
dei registri richiesti. La risposta termina sempre con il and the contents of the requested registers. The
valore di checksum CRC. answer ends with the CRC.
FUNZIONE 07: READ EXCEPTION STATUS FUNCTION 07: READ EXCEPTION STATUS
Tale funzione permette di leggere lo stato in cui si This function allows to read the status of the
trova il commutatore di linea. automatic transfer switch.
La tabella seguente riporta il significato del byte The following table gives the meaning of the status
inviato dalla Lexys AMF come risposta: byte sent by the LEXYS AMF as answer:
ERRORI ERRORS
Nel caso lo slave riceva un messaggio errato, In case the slave receives an incorrect message, it
segnala la condizione al master rispondendo con un answers with a massage composed by the queried
messaggio composto dalla funzione richiesta in OR function ORed with 80 Hex, followed by an error
con 80 Hex, seguita da un codice di errore. code byte.
Nella seguente tabella vengono riportati i codici di In the following table are reported the error codes
errore inviati dallo slave al master: sent by the slave to the master:
· Il campo Indirizzo contiene l’indirizzo dello · The Address field holds the serial address of the
strumento slave cui il messaggio viene inviato. slave destination device.
· Il campo Funzione contiene il codice della funzione ·The Function field holds the code of the function
che deve essere eseguita dallo slave. that must be executed by the slave.
· Il campo Dati contiene i dati inviati allo slave o · The Data field contains data sent to the slave or
quelli inviati dallo slave come risposta ad una data received from the slave in response to a query.
domanda. La massima lunghezza consentita e’ di The maximum allowable length is of (read pag. 3)
(ved. Pag. 3) registri consecutivi. consecutive registers.
· Il campo LRC consente sia al master che allo · The LRC field allows the master and slave
slave di verificare se ci sono errori di trasmissione. devices to check the message integrity. If a
Questo consente, in caso di disturbo sulla linea di message has been corrupted by electrical noise or
trasmissione, di ignorare il messaggio inviato per interference, the LRC field allows the devices to
evitare problemi sia dal lato master che slave. recognize the error and thereby ignore the
message.
· Il messaggio termina sempre con i caratteri di · The message terminates always with CRLF
controllo CRLF (0D 0A). control character (0D 0A).
Esempio: Example:
Per esempio, se si vuole leggere dal DMG con For instance, to read the value of the current phase
indirizzo 8 il valore della corrente di fase L3 L3, which resides at location 12 (0C Hex) from the
equivalente che si trova alla locazione 12 (0C Hex), slave with serial address 08, the message to send is
il messaggio da spedire è il seguente: the following:
: 08 04 00 0B 00 02 E7 CRLF : 08 04 00 0B 00 02 E7 CRLF
Dove: Whereas:
: = ASCII 3Ah = Delimitatore inizio messaggio : = ASCII 3Ah message start delimiter
08 = indirizzo slave. 08 = slave address
04 = funzione di lettura locazione. 04 = Modbus® function ‘Read input register’
00 0B = indirizzo della locazione diminuito di un’unità, 00 0B = Address of the required register (L3 current
contenente il valore della corrente di fase L3 phase ) decreased by one
00 02 = numero di registri da leggere a partire
dall’indirizzo 04. 00 02 = Number of registers to be read beginning
E7 = checksum LRC. from address 04
CRLF = ASCII 0Dh 0Ah = delimitatore fine E7= LRC Checksum
messaggio CRLF = ASCII 0Dh 0Ah = Message end delimiter
Dove: Whereas:
: = ASCII 3Ah = Delimitatore inizio messaggio : = ASCII 3Ah message start delimiter
08 = indirizzo del DMG (Slave 08). 08 = DMG address (Slave 08)
04 = funzione richiesta dal Master. 04 = Function requested by the master
04 = numero di byte inviati dallo slave. 04 = Number of bytes sent by the multimeter
00 00 A8 AE = valore esadecimale della corrente di 00 00 A8 AE = Hex value of the current phase of L3
fase L3 = 4.3182 A. (= 4.3182 A.)
9B = checksum LRC. 9B = LRC checksum
CRLF = ASCII 0Dh 0Ah = delimitatore fine CRLF = ASCII 0Dh 0Ah = Message end delimiter
messaggio
Inizializzazione CRC 1111 1111 1111 1111 CRC initialization 1111 1111 1111 1111
CRC xor BYTE = CRC Carica primo byte 0000 0010 Load the first byte 0000 0010
Esegue xor con il primo 1111 1111 1111 1101 Execute xor with the first 1111 1111 1111 1101
Byte della frame Byte of the frame
n=0 Esegue primo shift a dx 0111 1111 1111 1110 1 Execute 1st right shift 0111 1111 1111 1110 1
Carry=1,carica polinomio 1010 0000 0000 0001 Carry=1,load polynomial 1010 0000 0000 0001
Esegue xor con il 1101 1111 1111 1111 Execute xor with the 1101 1111 1111 1111
polinomio polynomial
CRC right shift Esegue secondo shift dx 0110 1111 1111 1111 1 Execute 2nd right shift 0110 1111 1111 1111 1
Carry=1,carica polinomio 1010 0000 0000 0001 Carry=1,load polynomial 1010 0000 0000 0001
Esegue xor con il 1100 1111 1111 1110 Execute xor with the 1100 1111 1111 1110
polinomio polynomial
carry over Esegue terzo shift 0110 0111 1111 1111 0 Execute 3rd right shift 0110 0111 1111 1111 0
Esegue quarto shift 0011 0011 1111 1111 1 Execute 4th right shift 0011 0011 1111 1111 1
Carry=1, carica polinomio 1010 0000 0000 0001 Carry=1,load polynomial 1010 0000 0000 0001
Esegue xor con il 1001 0011 1111 1110 Execute xor with the 1001 0011 1111 1110
CRC xor POLY = CRC Polinomio polynomial
Esegue quinto shift dx 0100 1001 1111 1111 0 Execute 5th right shift 0100 1001 1111 1111 0
Esegue sesto shift dx 0010 0100 1111 1111 1 Execute 6th right shift 0010 0100 1111 1111 1
Carry=1, carica polinomio 1010 0000 0000 0001 Carry=1,load polynomial 1010 0000 0000 0001
n=n+1 Esegue xor con polinomio 1000 0100 1111 1110 Execute xor with the 1000 0100 1111 1110
polynomial
Esegue settimo shift dx 0100 0010 0111 1111 0 Execute 7th right shift 0100 0010 0111 1111 0
n>7 Esegue ottavo shift dx 0010 0001 0011 1111 1 Execute 8th right shift 0010 0001 0011 1111 1
no yes Carry=1, carica polinomio 1010 0000 0000 0001 Carry=1,load polynomial 1010 0000 0000 0001
next BYTE Carica secondo byte 0000 0111 Load the second byte 0000 0111
della frame of the frame
Esegue xor con il 1000 0001 0011 1001 Execute xor with the 1000 0001 0011 1001
Secondo byte della frame Second byte of the frame
end message Esegue primo shift dx 0100 0000 1001 1100 1 Execute 1st right shift 0100 0000 1001 1100 1
no Carry=1, carica polinomio 1010 0000 0000 0001 Carry=1,load polynomial 1010 0000 0000 0001
yes Esegue xor con il 1110 0000 1001 1101 Execute xor with the 1110 0000 1001 1101
polinomio polynomial
End Esegue secondo shift dx 0111 0000 0100 1110 1 Execute 2nd right shift 0111 0000 0100 1110 1
Carry=1, carica polinomio 1010 0000 0000 0001 Carry=1,load polynomial 1010 0000 0000 0001
Esegue xor con il 1101 0000 0100 1111 Execute xor with the 1101 0000 0100 1111
polinomio polynomial
Algoritmo di calcolo del CRC Esegue terzo shift dx 0110 1000 0010 0111 1 Execute 3rd right shift 0110 1000 0010 0111 1
CRC calculation algorithm Carry=1, carica polinomio 1010 0000 0000 0001 Carry=1,load polynomial 1010 0000 0000 0001
Esegue xor con il 1100 1000 0010 0110 Execute xor with the 1100 1000 0010 0110
polinomio polynomial
Esegue quarto shift dx 0110 0100 0001 0011 0 Execute 4th right shift 0110 0100 0001 0011 0
Esegue quinto shift dx 0010 0100 0000 1001 1 Execute 5th right shift 0010 0100 0000 1001 1
Carry=1, carica polinomio 1010 0000 0000 0001 Carry=1,load polynomial 1010 0000 0000 0001
Esegue xor con il 1001 0010 0000 1000 Execute xor with the 1001 0010 0000 1000
polinomio polynomial
Esegue sesto shift dx 0100 1001 0000 0100 0 Execute 6th right shift 0100 1001 0000 0100 0
Esegue settimo shift dx 0010 0100 1000 0010 0 Execute 7th right shift 0010 0100 1000 0010 0
Esegue ottavo shift dx 0001 0010 0100 0001 0 Execute 8th right shift 0001 0010 0100 0001 0
Risultato CRC 0001 0010 CRC Result 0001 0010
0100 0001 0100 0001
12h 41h 12h 41h
Nota: Il byte 41h viene spedito per primo (anche se Note: The byte 41h is sent first(even if it is the
e’ il LSB), poi viene trasmesso 12h. LSB), then12h is sent.
CALCOLO LRC (CHECKSUM per ASCII) LRC CALCULATION (CHECKSUM for ASCII)
Œ Esempio: Œ Example:
Il valore all’indirizzo 2100H è 0x05 (esadecimale), The value at address 2100H is 0x05 (hexadecimal)
= 0x00000101 vuol dire che gli ingressi 1 e 3 sono = 0x00000101 means that the inputs 1 and 3 are
attivi. active
•Leggendo la word agli indirizzi 2210H vengono •Reading the word at address0 2210H will return
restituiti 32 Bit con significato com da tabella 32 bits with the following meaning:
Œ Scrivendo il valore AAH all’indirizzo indicato viene Œ Writing AAh to the indicated address the remte
impostata la variabile remota a 1, scrivendo BBH variable will be set to 1, writing BBH the remote
viene impostata a 0. variable will be set to 0
• La seguente tabella indica i valori da scrivere • The following table shows the values to be
all’indirizzo 2F00H per ottenere le corrispondenti written to address 2F00H to achieve the
funzioni correspondent function
Ž La seguente tabella indica la posizioni dei bit da Ž The following table shows the bit positionof the
scrivere all’indirizzo 2F0AH per ottenere le corrispondenti value to be written to address 2F0AH to achieve the
funzioni correspondent function
Per leggere gli eventi bisogna svolgere la seguente To read the events must do the following:
procedura:
1. Eseguire la lettura di 1 registro con la funzione 1. Perform the read of 1 register by using the
4 all’ indirizzo 5030H, il byte più significativo function 4 at address 5030H, the most
(msb) indica quanti eventi sono memorizzati significant byte (msb) indicates how many
(valore compreso tra 0 a 250), il byte meno events are stored (value between 0 to 250),
significativo viene incrementato ogni volta che the least significant byte (lsb) is incremented
un evento viene salvato (valore compreso tra 0 each time an event is saved (value between 0
a 250).Una volta memorizzati 250 eventi l’msb to 250). Once stored the 250 events the msb
resterà a 250 mentre l’lsb tornerà a zero e poi will remain at 250 while the lsb will back to
continuerà ad incrementare. zero and after will continue to increase.
2. Impostare l’indice dell’evento che si vuole 2. Set the index of the event that you want to
leggere (minore del numero massimo di eventi read (less than the maximum number of
memorizzati),per fare questo bisogna eseguire events stored), to do this you performe the
la funzione 6 all’indirizzo 5030H, specificando function 6 at 5030H, specifying which event
quale evento leggere. read.
3. Eseguire una lettura di 43 registri (con un'unica 3. Perform a read of 43 registers (with a single
funzione 4) all’indirizzo 5032H function 4) at address 5032H
4. Il valore tornato è una stringa di 86 caratteri 4. The value returned is a string of 86 ASCII
ASCII, che riportano la stessa descrizione characters, showing the same event
dell’evento visibile sul display della Lexys. description visible on the Lexys display. The
L’indice dell’evento che si vuole leggere viene index of the event to be read is incremented
incrementato in automatico dopo la lettura del automatically after a reading of the register
registro 5032H,al fine di velocizzare il 5032H, in order to speed up the download of
download degli eventi events
5. Se si vuole leggere l’evento successivo 5. If you want to read the next event performing
eseguire il punto 3,se si vuole leggere un step 4, if you want to read any other event do
qualsiasi altro evento eseguire il passo 2. step 3.
Tramite il protocollo Modbus® e’ possibile accedere Using the Modbus® protocol it is possible to access
ai parametri dei menu. the menu parameters.
Per interpretare correttamente la corrispondenza fra To correctly understand the correspondence
valore numerico e funzione selezionata e/o unita’ di between the numeric value and the selected
misura, fare riferimento al manuale operativo della function and/or the unit of measure, please see the
Lexys. LEXYS operating manual.
Œ E’ possibile leggere il valore del menu, sottomenu ŒIt’s 'possible to read the menu, submenus, and
e parametro memorizzati agli indirizzi 5000H,5001H parameter stored at the addresses 5000H, 5001H
e 5002H utilizzando la funzione 4 and 5002H by using the function 4