MANUALE OPERATIVO / INSTRUCTION MANUAL IM-IU v0.1 EML-16 Concentratore impulsi PROTOCOLLO DI COMUNICAZIONE MODBUS EML-16 Pulses concentrator MODBUS COMMUNICATION PROTOCOL
PROTOCOLLO MODBUS Il concentratore d impulsi EML-16 supporta il protocollo di comunicazione Modbus RTU sulla porta seriale RS-485. Quando si utilizza il protocollo Modbus RTU, la struttura del messaggio di comunicazione è così costituita: MODBUS PROTOCOL The pulses concentrator EML-16 supports the communication Protocol Modbus RTU on the RS-485 serial port. If one selects the Modbus RTU protocol, the structure communication message has the following: Start frame Indirizzo (8 bit) (8 bit) Dati (N x 8 bit) CRC (16bit) End frame Start frame Address (8 bit) (8 bit) Data (N x 8 bit) CRC (16bit) End frame Il campo Indirizzo contiene l indirizzo dello strumento slave cui il messaggio viene inviato. Il campo 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. Il campo CRC consente sia al master che allo slave di verificare se ci sono errori di trasmissione. The Address field holds the serial address of the slave destination device. The field holds the code of the function that must be executed by the slave. The Data field contains data sent to the salve or data received from the slave in response to a query. The CRC field allows the master and slave devices to check the message integrity. FUNZIONI MODBUS Le funzioni disponibili sono: MODBUS FUNCTIONS The available functions are: 03H = Read input register 10H = Preset multiple register Consente la lettura delle misure disponibili nell EML-16 Permette la scrittura di più parametri 03H = Read input register 10H = Preset multiple register Allows to read the EML-16 measures Allows writing multiple parameters Tempo di risposta EML-16: Caso tipico: 100ms Caso peggiore: 300ms EML-16 response time: Typical case: 100ms Worst case: 300ms
FUNZIONE 03H: READ INPUT REGISTER La funzione 03 permette di leggere una o più grandezze consecutive in memoria. L indirizzo di ciascuna grandezza è indicato nelle tabelle riportate nelle utlime pagine del presente manual. Se l indirizzo richiesto non è compreso nella tabella o il numero di registri richiesti è maggiore del numero consentito, l EML-16 ritorna un messaggio di errore (vedi tabella errori). Richiesta Master: FUNCTION 03H: READ INPUT REGISTER The Modbus function 03 allows to read one or more consecutive registers from the slave. The address of each measures is given in the tables on the final page of this manual. If the measure address is not included in the table or the number of requested registers exceeds the acceptable max number, the EML-16 will return an error code (see error table). Master query: MSB indirizzo registro LSB indirizzo registro MSB numero registri LSB numero registri 03h 04h 45h F5h Slave address MSB register address LSB register address MSB register number LSB register number 03h 04h 45h F5h Nell esempio vengono richiesti, allo slave numero 1, 4 registri consecutivi a partire dall indirizzo 01. Quindi vengono letti I registri dal 0103h al. Il commando termina sempre con il valore checksum CRC. In the above example, slave 1 is requested for 4 consecutive registers beginning with address 01. Thus, registers from 01 to 0103h will be returned. As usual, the message ends with CRC checksum. Risposta Slave: 03h Numero di byte 08h MSB dato 01 00 LSB dato 01 1F42h -------------------------------------------------------------------- --------- MSB dato 0103h 00 LSB dato 0103h 3E82h 7Fh B6h 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. Slave response: 03h Byte number 08h MSB data register 01 00 LSB data register 01 1F42h -------------------------------------------------------------------- --------- MSB data register 0103h 00 LSB data register 0103h 3E82h 7Fh B6h 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.
FUNZIONE 10H: PRESET MULTIPLE REGISTER Questa funzione permette di modificare più parametri consecutivamente o parametri composti da più di 2 byte. E permessa la scrittura di massimo 2 registri consecutivi. Richiesta Master: FUNCTION 10H: PRESET MULTIPLE REGISTER This function allows to modify multiple parameters with a single message, or to preset a value longer that one register. It has allowed the writing of a maximum of 2 consecutive registers. Master query: MSB indirizzo registro LSB indirizzo registro MSB numero registri LSB numero registri Numero byte MSB Dato LSB Dato 10h 50h 3Ch 02h C8h F2h FFh Slave address MSB register address LSB register address MSB register number LSB register number Byte number MSB Data LSB Data 10h 50h 3Ch 02h C8h F2h FFh Risposta Slave: Slave response: MSB indirizzo registro LSB indirizzo registro MSB numero byte LSB numero byte 10h 50h 3Ch D0h C5h Slave address MSB register address LSB register address MSB byte number LSB byte number 10h 50h 3Ch D0h C5h 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 80h, seguita da un codice di errore. Nella seguente tabella vengono riportati i codici di errore inviati dallo slave al master. CODE ERRORE 01 non valida 02 Indirizzo registro illegale 03 Valore del parametro fuori range ERRORS In case the slave receives an incorrect message, it answers with a message composed by the queried function OR with 80h, followed by an error code byte. In the following table are reported the error codes sent by the slave to the master. CODE ERROR 01 Invalid function 02 Invalid address 03 Parameter out of range
MISURE FORNITE DAL PROTOCOLLO DI COM. (Utilizzabili con funzione 03H) MEASURES SUPPLIED BY COM. PROTOCOL (To be used with function 03H) INDIRIZZO UNITA FORMATO WORDS MISURA MEASURE ADDRESS UNIT FORMAT 0100H 2 Contatore totale 1 Total counter 1 unsigned long 0102H 2 Contatore totale 2 Total counter 2 unsigned long 0104H 2 Contatore totale 3 Total counter 3 unsigned long 0106H 2 Contatore totale 4 Total counter 4 unsigned long 0108H 2 Contatore totale 5 Total counter 5 unsigned long 010AH 2 Contatore totale 6 Total counter 6 unsigned long 010CH 2 Contatore totale 7 Total counter 7 unsigned long 010EH 2 Contatore totale 8 Total counter 8 unsigned long 0110H 2 Contatore totale 9 Total counter 9 unsigned long 0112H 2 Contatore totale 10 Total counter 10 unsigned long 0114H 2 Contatore totale 11 Total counter 11 unsigned long 0116H 2 Contatore totale 12 Total counter 12 unsigned long 0118H 2 Contatore totale 13 Total counter 13 unsigned long 011AH 2 Contatore totale 14 Total counter 14 unsigned long 011CH 2 Contatore totale 15 Total counter 15 unsigned long 011EH 2 Contatore totale 16 Total counter 16 unsigned long 0140H 2 Contatore parziale 1 Partial counter 1 unsigned long 0142H 2 Contatore parziale 2 Partial counter 2 unsigned long 0144H 2 Contatore parziale 3 Partial counter 3 unsigned long 0146H 2 Contatore parziale 4 Partial counter 4 unsigned long 0148H 2 Contatore parziale 5 Partial counter 5 unsigned long 014AH 2 Contatore parziale 6 Partial counter 6 unsigned long 014CH 2 Contatore parziale 7 Partial counter 7 unsigned long 014EH 2 Contatore parziale 8 Partial counter 8 unsigned long 0150H 2 Contatore parziale 9 Partial counter 9 unsigned long 0152H 2 Contatore parziale 10 Partial counter 10 unsigned long 0154H 2 Contatore parziale 11 Partial counter 11 unsigned long 0156H 2 Contatore parziale 12 Partial counter 12 unsigned long 0158H 2 Contatore parziale 13 Partial counter 13 unsigned long 015AH 2 Contatore parziale 14 Partial counter 14 unsigned long 015CH 2 Contatore parziale 15 Partial counter 15 unsigned long 015EH 2 Contatore parziale 16 Partial counter 16 unsigned long 0180H 2 Matematico 1 Mathematics 1 unsigned long 0182H 2 Matematico 2 Mathematics 2 unsigned long 0184H 2 Matematico 3 Mathematics 3 unsigned long 0186H 2 Matematico 4 Mathematics 4 unsigned long 0188H 2 Matematico 5 Mathematics 5 unsigned long 018AH 2 Matematico 6 Mathematics 6 unsigned long 018CH 2 Matematico 7 Mathematics 7 unsigned long 018EH 2 Matematico 8 Mathematics 8 unsigned long 0190H 2 Matematico 9 Mathematics 9 unsigned long 0192H 2 Matematico 10 Mathematics 10 unsigned long 0194H 2 Matematico 11 Mathematics 11 unsigned long 0196H 2 Matematico 12 Mathematics 12 unsigned long 0198H 2 Matematico 13 Mathematics 13 unsigned long 019AH 2 Matematico 14 Mathematics 14 unsigned long 019CH 2 Matematico 15 Mathematics 15 unsigned long 019EH 2 Matematico 16 Mathematics 16 unsigned long
PARAMETRI SETUP (Utilizzabili con funzioni 03H e 10H) SETUP PARAMETERS (To be used with functions 03H and 10H) INDIRIZZO ADDRESS WORDS MENU MENU MIN MAX DEF Generale General 4000H+(n-1) 8 Descrizione del contatore Counter description - - CTNn 5000H+(n-1) 2 Unità di misura del contatore Counter unit of measure 0 2 kwh+ 503AH+(n-1) 2 Moltiplicatore Multiplier 1 1000 1 5064H+(n-1) 2 Divisore Divider 1 1000 10 Password Password 51 Abilitazione password Enable password 0 1 0 5102h Password utente User password 0000 9999 0000 Comunicazione Communication 52 Indirizzo seriale nodo Serial node address 1 247 1 52 Velocità seriale Serial speed 1 8 6 5202h Formato dati Data format 1 3 1 5203h Bit di stop Stop bits 1 22 1 Unità di misura del contatore 0 = Wh+ 8 = m 3 1 = Wh- 9 = Nm 3 2 = VArh+ 10 = kwh+ 3 = VArh- 11 = kwh- 4 = Vah 12 = kvarh+ 5 = Nessuna 13 = kvarh- 6 = J 14 = kvah 7 = Pulse Velocità seriale 1 = 1200bps 5 = 19200bps 2 = 2400bps 6 = 38400bps 3 = 4800bps 7 = 57600bps 4 = 9600bps 8 = 115200bps Formato dati 1 = 8 bit, no parità 2 = 8 bit, dispari 3 = 8 bit, pari Bit di stop 1 = 1 bit di stop 2 = 2 bit di stop Counter unit of measure 0 = Wh+ 8 = m 3 1 = Wh- 9 = Nm 3 2 = VArh+ 10 = kwh+ 3 = VArh- 11 = kwh- 4 = Vah 12 = kvarh+ 5 = Nessuna 13 = kvarh- 6 = J 14 = kvah 7 = Pulse Serial speed 1 = 1200bps 5 = 19200bps 2 = 2400bps 6 = 38400bps 3 = 4800bps 7 = 57600bps 4 = 9600bps 8 = 115200bps Data format 1 = 8 bit, no parity 2 = 8 bit, odd 3 = 8 bit, even Stop bits 1 = 1 stop bits 2 = 2 stop bits
COMANDI (Utilizzabili con funzione 10H) COMMANDS (To be used with function 10H) INDIRIZZO UNITA FORMATO WORDS MISURA MEASURE ADDRESS UNIT FORMAT 2FF0H 1 Azzera contatore totale 1 Reset total counter 1 1 Unsigned int 2FF0H 1 Azzera contatore totale 2 Reset total counter 2 2 Unsigned int 2FF0H 1 Azzera contatore totale 3 Reset total counter 3 3 Unsigned int 2FF0H 1 Azzera contatore totale 4 Reset total counter 4 4 Unsigned int 2FF0H 1 Azzera contatore totale 5 Reset total counter 5 5 Unsigned int 2FF0H 1 Azzera contatore totale 6 Reset total counter 6 6 Unsigned int 2FF0H 1 Azzera contatore totale 7 Reset total counter 7 7 Unsigned int 2FF0H 1 Azzera contatore totale 8 Reset total counter 8 8 Unsigned int 2FF0H 1 Azzera contatore totale 9 Reset total counter 9 9 Unsigned int 2FF0H 1 Azzera contatore totale 10 Reset total counter 10 10 Unsigned int 2FF0H 1 Azzera contatore totale 11 Reset total counter 11 11 Unsigned int 2FF0H 1 Azzera contatore totale 12 Reset total counter 12 12 Unsigned int 2FF0H 1 Azzera contatore totale 13 Reset total counter 13 13 Unsigned int 2FF0H 1 Azzera contatore totale 14 Reset total counter 14 14 Unsigned int 2FF0H 1 Azzera contatore totale 15 Reset total counter 15 15 Unsigned int 2FF0H 1 Azzera contatore totale 16 Reset total counter 16 16 Unsigned int 2FF2H 1 Azzera contatore parziale 1 Reset partial counter 1 1 Unsigned int 2FF2H 1 Azzera contatore parziale 2 Reset partial counter 2 2 Unsigned int 2FF2H 1 Azzera contatore parziale 3 Reset partial counter 3 3 Unsigned int 2FF2H 1 Azzera contatore parziale 4 Reset partial counter 4 4 Unsigned int 2FF2H 1 Azzera contatore parziale 5 Reset partial counter 5 5 Unsigned int 2FF2H 1 Azzera contatore parziale 6 Reset partial counter 6 6 Unsigned int 2FF2H 1 Azzera contatore parziale 7 Reset partial counter 7 7 Unsigned int 2FF2H 1 Azzera contatore parziale 8 Reset partial counter 8 8 Unsigned int 2FF2H 1 Azzera contatore parziale 9 Reset partial counter 9 9 Unsigned int 2FF2H 1 Azzera contatore parziale 10 Reset partial counter 10 10 Unsigned int 2FF2H 1 Azzera contatore parziale 11 Reset partial counter 11 11 Unsigned int 2FF2H 1 Azzera contatore parziale 12 Reset partial counter 12 12 Unsigned int 2FF2H 1 Azzera contatore parziale 13 Reset partial counter 13 13 Unsigned int 2FF2H 1 Azzera contatore parziale 14 Reset partial counter 14 14 Unsigned int 2FF2H 1 Azzera contatore parziale 15 Reset partial counter 15 15 Unsigned int 2FF2H 1 Azzera contatore parziale 16 Reset partial counter 16 16 Unsigned int 2FF4H 1 Azzera contatori totali Reset total counters 255 Unsigned int 2FF6H 1 Azzera contatori parziali Reset partial counters 255 Unsigned int 2FF8H 1 Setup a default Parameters to default 255 Unsigned int
Per ulteriori informazioni contattare: For further details please contact: Contrel elettronica s.r.l. Via San Fereolo, 9 I-26900 Lodi Tel: +39 0371 30207 / 30761 / 35386 Fax: +39 0371 32819 E-Mail: contrel@contrel.eu www.contrel.it