The registers with the measurement value are in the integer format of 32-bit sign (in C/C++ type int).
The actual measurement value is obtained from the read register using the following algorithms, using the appropriate factor value
DW
(see table above)
Algorithm 1.
Readout register is saved to regular type variable (float) and then divide it by the factor
DW
.
// Fragment of code in C language (VS6.0) presenting above algorithm
int
iMeasurementReg;
float fMeasurmentValue
......
fMeasurmentValue = (float)iMeasurementRegister;
fMeasurmentValue = fMeasurmentValue /
DW
;
Algorithm 2.
Readout register is saved to regular type variable 32-bit (int) and then divide by the factor
DW
, received change of the
dividing it is a number of the hundredth parts of the measurement value.
// Fragment of code in C language (VS6.0) presenting above algorithm
int
iMeasurementReg;
div_t div_MeasurmentValue;
......
div_MeasurmentValue = div((int)iMeasurementRegister,
DW
)
printf( "Total measurement value = %d\n, hundredth parts of the measurement value = %d\n",
div_MeasurmentValue.quot, div_MeasurmentValue.rem );
Query of register Eac
Byte no
Designation
Size
Value [hex]
00
Inverter address
1 byte
11 [ 11 to F7]
01
Function code
1 byte
03 / 04
02
Registry address Hi
1 byte
00
03
Registry address Lo
1 byte
08
04
Registry number Hi
1 byte
00
05
Registry number Lo
1 byte
02
06
CRC-Lo
1 byte
---
07
CRC-Hi
1 byte
---
Example.
Query of AC network energy meter
Eac
from registry address 40009 / address 30009
11-03-00-08-00-02-CRCLo-CRCHi
11-04-00-08-00-02-CRCLo-CRCHi
Response with register value
Eac
Byte no
Designation
Size
Value [hex]
00
Inverter address
1-byte
11 [ 11 to F7]
01
Function code
1-byte
03 / 04
02
Number of data bytes N-byte
04
03
Dane1-Hi
1-byte
00
04
Dane1-Lo
1-byte
00
05
Dane2-Hi
1-byte
0B
06
Dane2-Lo
1-byte
90
07
CRC-Lo
1-byte
---
08
CRC-Hi
1-byte
---
Example. Readout of AC network energy meter Eac from registry address 40009 / address 30009
11-03-04-00-00-0B-90-CRCLo-CRCHi
11-04-04-00-00-0B-90-CRCLo-CRCHi
In respond the value of AC network energy meter
Eac
is presented as 4-byte with values:
Eac
= 0x00000B90 => 2960/100 => 29,60 kWh
Response - in case of error
Byte no
Designation
Size
Value [hex]
00
Inverter address
1-byte
11 [ 11 do F7]
15
ADA-4040PC3