![CEL-MAR ADA-4040PC6 User Manual Download Page 19](http://html1.mh-extra.com/html/cel-mar/ada-4040pc6/ada-4040pc6_user-manual_2579191019.webp)
Algorithm 2.Readout register is saved to regular type variable 16-bit
(short 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.
// The fragment of code in C language (VS6.0) presenting above algorithm
short int siMeasurementReg;
div_t div_MeasurmentValue;
......
div_MeasurmentValue= div((int)siMeasurementRegister,
DW
)
printf( "Total measurement value = %d\n, Hundredths of measured values= %d\n",
div_MeasurmentValue.quot, div_MeasurmentValue .rem );
8.4.1.2. READOUT TALKER ID FROM 16-BIT REGISTER [4X / 3X-REFERENCES]
0x03 / 0x04 Function are used for readout of converter registers value.
Example query MODBUS-RTU about TALKER ID from NMEA0183 protocol is shown below.
Query about TALKER ID register
Byte no
Designation
Size
Value [hex]
00
Converter address
1 Byte
11 [ 11 do F7]
01
Function code
1 Byte
03 / 04
02
Registry address Hi
1 Byte
00
03
Registry address Lo
1 Byte
00
04
Registry number Hi
1 Byte
00
05
Registry number Lo
1 Byte
01
06
CRC-Lo
1 Byte
---
07
CRC-Hi
1 Byte
---
Example.
Query TALKER ID from registry address 40001 / address 30001
11-03-00-00-00-01-CRCLo-CRCHi
11-04-00-00-00-01-CRCLo-CRCHi
Response with
TALKER ID value
Byte no
Designation
Size
Value [hex]
00
Converter address
1-Byte
11 [ 11 do F7]
01
Function code
1-Byte
03 / 04
02
Data bytes number
N-Byte
02
03
Dane1-Hi
1-Byte
47
04
Dane1-Lo
1-Byte
50
05
CRC-Lo
1-Byte
---
06
CRC-Hi
1-Byte
---
Example.
Readout TALKER ID from register address 40001 / address 30001
11-03-02-47-50-CRCLo-CRCHi
11-04-02-47-50-CRCLo-CRCHi
In respond TALKER ID is presented as 2-byte with values (Hex): 0x47, 0x50 ( ASCII : G, P ) .
Response
– in case or error
Byte no
Designation
Size
Value [hex]
00
Converter address 1-Byte
11 [ 11 to F7]
01
Function code
1-Byte
83 / 84
02
Error code
1-Byte
01 – unknown function
02 – unknown data address
03 – unknown data value
04 – NMEA0183 device not respond or is faulty
03
CRC-Lo
1-Byte
19
ADA-4040PC6
Summary of Contents for ADA-4040PC6
Page 23: ...23 ADA 4040PC6...