136
edits
| (2 intermediate revisions by the same user not shown) | |||
| Line 28: | Line 28: | ||
* (u8) Network address | * (u8) Network address | ||
* (u8) Confirmation of the command (always 0х03) | * (u8) Confirmation of the command (always 0х03) | ||
* (u8) | * (u8) Number of bytes requested (always 0x08) | ||
* (s8) Temperature | * (s8) Temperature | ||
* (u8) High byte of Level | * (u8) High byte of Level | ||
| Line 89: | Line 89: | ||
= '''Example of TD-500 sensor polling in Terminal program''' = | = '''Example of TD-500 sensor polling in Terminal program''' = | ||
1 | 1 response - response to a request via LLS protocol | ||
2 | 2 response - response to a request via ModBUS RTU protocol | ||
TD-500 polling in the Terminal program | |||
$01$03$00$00$00$04$44$09 Command to poll a sensor via Modbus RTU protocol | |||
* 01 | * 01 Sensor network address | ||
* 03 | * 03 Requested command to read registers | ||
* 00 00 | * 00 00 Register starting from which data is requested | ||
* 00 04 | * 00 04 Number of requested registers | ||
* 44 09 | * 44 09 CRC-16 MODBUS checksum | ||
If you specify a different network address, you need to recalculate the checksum. But there is no point in changing the network address, since the sensor will respond to any network address. | |||
== '''Checksum calculation''' == | == '''Checksum calculation''' == | ||
In order to calculate the checksum, you can go to the site '''<nowiki>https://crccalc.com</nowiki>''' and enter your request '''without the $ sign''', select HEX, '''CRC-16 ModBUS''' and click Calc CRC-16 | |||
Calculating the checksum on the [https://crccalc.com crccalc site] | |||
The resulting value must be written to the command being sent. In this case, the value obtained during the calculation 0C 44 should be written to the command as 44 0C. | |||
= '''Response from the sensor:''' = | == '''Response from the sensor:''' == | ||
'''01 03 08 14 04 67 00 00 00 00 00 D8 FF''' | '''01 03 08 14 04 67 00 00 00 00 00 D8 FF''' | ||
* 01 - | * 01 - Sensor network address | ||
* 03 - | * 03 - Read command | ||
* 08 - | * 08 - Number of bytes in response | ||
* 14 - | * 14 - Temperature HEX (20°C in DEC) | ||
* 04 67 - | * 04 67 - Bytes of level Big Endian HEX (1127 in DEC) | ||
* 00 00 00 00 00 - | * 00 00 00 00 00 - reserve 5 bytes, not used | ||
* D8 FF - CRC-16 ModBUS | * D8 FF - CRC-16 ModBUS checksum Little Endian HEX (FF D8) | ||