![Esam E1200 Скачать руководство пользователя страница 8](http://html.mh-extra.com/html/esam/e1200/e1200_user-manual_2425208008.webp)
MANUALE D’USO / USER’S GUIDE
E1200
[email protected] www.esam.biz
page 8 - 16
rev. 1.07
0714
PROTOCOLLO MODBUS RTU /
MODBUS RTU PROTOCOL
Funzioni Modbus RTU implementate:
- 03 read holding registers.
E’ possibile leggere fino a 120 word
per volta. Entrambe le word dei valori valori floating point devono
essere lette con una singola richiesta.
Se
l’indirizzo iniziale o finale cade in mezzo ad un valore floating
point verrà ritornato un codice di errore (illegal address).
- 06 preset single register.
Questo comando funziona solo con
valori interi. I valori floating point devono essere scritti con
“preset
multiple register”
- 16 preset multiple register.
Questo comando è utilizzato per
scrivere un valore floating point (2 word).
E’ utilizzabile anche per
scrivere un valore intero (1 word)
Si può scrivere un solo valore intero o floating point alla volta.
Modbus RTU functions implemented:
- 03 read holding registers.
Up to 120 words of contiguous data
can be retrieved at a time. Both words of floating point values must
be read with a single query. The instrument sends back an exception
response (illegal address) if the initial and final register of the query
are not chosen properly
- 06 preset single register.
This command works only with integer
values. Floating point values must be written with “preset multiple
registers”
- 16 preset multiple register.
This command is intended to write a
floating point value (2 words). Can be used also to write an integer
value (1 word).
Only a single value at a time can be written (float or integer).
Tipi di dati.
La comunicazione seriale avviene tramite la
trasmissione di parole binarie di 16 bit (word). I dati sono di due tipi:
interi (una word) e floating point (2 word).
Esempio: Per leggere quattro misure partendo dal registro 100. si
dovranno chiedere 8 word, quindi i registri da 100 a 107.
Valori floating point.
I numeri floating point seguono la specifica
IEEE 32 bit floating point standard.
Data types.
Serial communication basically consists of 16 bit binary
words. Two data types are used: integer (one word) and floating
point (2 words).
Example: To read 4 measured values starting register 100,
8 words are required, that is from register 100 to 107.
Floating point value.
According to the IEEE 32 bit standard format,
a floating point value is coded as follows:
MSB
LSB
seeeeeee : emmmmmmm
:
mmmmmmmm : mmmmmmmm
word A
word B
s
segno del numero 0 positivo 1 negativo
e
esponente a 8 bit
m
mantissa del numero 23 bit
Comando
SWFP
: Impostando 0 si riceverà prima la word A e poi la
word B; impostando 1 prima la word B e poi la word A
Codici di errore Modbus RTU implementati:
-
1 illegal function
- funzione non valida o non implementata.
-
2 illegal data address
- richiesta di lettura o scrittura ad un
indirizzo non valido. Es. registro inesistente, lettura di una sola
word di un valore float.
-
3 illegal data value
- scrittura di un valore non valido, ad esempio
fuori dai limiti ammessi.
s
Sign bit. ”0” if the value is positive, “1” if the value is negative
e
8 bit exponent
m
The mantissa, which is coded in 23 bits.
SWFP
Command: Setting to 0 word A will be sent before word B;
setting 1 word B will be sent before word A.
Modbus RTU implemented exception codes:
-
1 illegal function
- invalid or non implemented function
.
-
2 illegal data address
- read or write request at an invalid
address. Ex. Non existent register, read one word only of a
floating point value.
-
3 illegal data value
- write request of an invalid value, e.g. out of
allowed limits.
BLOCCO VIRTUALE DI REGISTRI MODBUS /
VIRTUAL BLOCK OF MODBUS REGISTERS
La lettura di un blocco di registri modbus è molto più efficiente della
lettura separata di tante singole variabili, ma richiede che le variabili
occupino registri modbus consecutivi.
In questo strumento esiste la possibilità di creare un blocco virtuale,
che faccia apparire in sequenza variabili sparse.
La massima lunghezza del blocco virtuale è di 50 word.
Il blocco virtuale si trova nei registri modbus da 2100 a 2149.
La definizione delle variabili del blocco virtuale si trova nei registri
modbus da 2000 a 2049.
Esempio 1:
Scrivendo nei registri modbus da 2000 a 2005 i numeri 100, 0, 122,
0, 144, 0, ogni successiva richiesta di un blocco di 6 word a partire
dal registro 2100 ritornera' i valori di V1 (registri 100-101), V2
(registri 122-123) e V3 (reg. 144-145).
Notare che ogni valore di 32 bit (float) occupa 2 registri virtuali e che
deve essere inserito uno zero come secondo registro
Esempio 2:
Scrivendo nei registri modbus 2000 ... 2005 i numeri 500, 501, 304,
0, 502, 503, ogni successiva richiesta di un blocco di 6 word a partire
dal registro 2100 ritornera' i valori di indirizzo di stazione (registro
500), baud rate (registro 501), rapporto TA esterno (registri 304-305
), minimo ritardo alla risposta (registro 502) e swap float (registro
503). Notare che il rapporto TA (float) richiede 2 registri virtuali e che
e' stato inserito uno zero come secondo registro.
Reading a block of Modbus registers with a single query is much
more efficient than reading individual variables, but works only if the
variables are located in contiguous registers.
This instrument allows to define a “virtual block” of variables, that is
to read an arbitrary chosen list of variables as if their were
contiguous. The maximum length of the virtual block is 50 words.
The virtual block is located in registers from 2100 to 2149.
The list of variables of the virtual block is defined in registers from
2000 to 2049
Example 1:
Writing the numbers 100, 0, 122, 0, 144,0, to Modbus registers from
2000 to 2005, any following query of a block of 6 words, starting from
register 2100 will return the values of V1 (registers 100-101), V2
(registers 122-123) and V3 (registers 144-145).
Please note that every float requires two virtual registers and that a
zero must be entered as second register.
Example 2:
Writing the numbers 500, 501,304, 0, 502, 503, to Modbus registers
from 2000 to 2005, any following query of a block of 6 words, starting
from register 2100 will return the values of station address (register
500), baud rate (register 501),external CT ratio (registers 304-305),
minimum reply delay time (register 502) and swap float (register
503). Please note that CT ratio (float) requires two virtual registers
and that a zero must be entered as second word register.