
7
CARLO GAVAZZI
CONTROLS
SERIAL COMMUNICATION PROTOCOL
WM4-96
V1 R3
Page
2.2 VARIABLE FORMAT
The value of all the instantaneous variables is stored as a 4 byte (2 word) integer value. The decimal
point and the multiplier have to be set according to the inf1/2 word coding (see the following table)
for voltage (V), current (A) and power (P), in the position “111.1” for the THD-type (%) and H-type
(Hz) type variables and in position “1.111” for the C-type variables (PF). The single phase PF
variables are stored with a positive value if the power factor is “L” (inductive), and with a negative
value if the power factor is “C” (capacitive). The variable “PF ∑“ has neither L nor C sign indication.
Variable format info map
Address Byte Variable Type
0E8
1 Info voltage value inf1
0E9
1 Info current value inf1
0EA
1 Info power value inf2
0EB
1 ---
Decimal point and multiplier coding
INF value
d.p INF value
d.p
0 1.111m 8 111.1k
1 11.11m 9 1111k
2 111.1m 10 11.11M
3 1.111 11 111.1M
4 11.11 12 1111M
5 111.1 13 11.11G
6 1111 14 111.1G
7 11.11K 15
NOTE: if a power value exceeds 9999, the autoranging function will intervene and modify the inf2
value. If the power value is lower than 99999 the inf2 will be increased of 1 unit, if the power value is
greater than 99999 but lower than 999999 the inf2 will be increased of 2 units and so on.
Example 1: reading of an int variable stored at address 100h
An int variable is 4 byte (2 word) long, so a 2-word read request must be sent:
Read command request frame
Address Function Word address n° of words CRC
1 byte 1 byte 2 byte 2 byte 2 byte
from 1 to 255 04 01h 00h 00h 02h MSB LSB
Read command answer frame
Address Function
n° byte
Value of int type variable CRC
1 byte 1 byte 1 byte 1° byte
2° byte
3° byte
4° byte 2 byte
from 1 to 255 04 04 LSB MSB MSB LSB
Example 2: reading of 4 char variables (4 bytes=2 words) starting from address 1C0h
Char type variables (1 byte) must always be read carrying out a 1-word (2-bytes) read request and
taking only the needed byte into account. Note that the first sent byte is the byte relevant to the
specified word address. The following bytes are relevant to the previous address+1.
Kommentare zu diesen Handbüchern