MODBUS TD-500: Difference between revisions

Line 27: Line 27:


*        (u8) Network address
*        (u8) Network address
*        (u8) Подтверждение команды (всегда 0х03)
*        (u8) Confirmation of the command (always 0х03)
*        (u8) Количество выгружаемых байт (всегда 8)
*        (u8) Количество выгружаемых байт (always 0x08)
*       (s8) Temperature
*       (s8) Temperature
*        (u8) High byte of Level
*        (u8) High byte of Level
*        (u8) Low byte of Level
*        (u8) Low byte of Level
*        (u8) Always 0
*        (u8) Always 0
Line 40: Line 40:
*        (u8) CRC16 - high byte
*        (u8) CRC16 - high byte


s8 означает, что значение является знаковым целым, u8 - беззнаковое целое.
s8 means the value is a signed integer, u8 means an unsigned integer.


Пронумерованные адреса байтов ответа:
Numbered addresses of the response bytes:
{| class="wikitable"
{| class="wikitable"
|Порядковый номер байта
|Byte ordinal number
|Порядковый номер байта начиная с 0
|Byte ordinal number starting from 0
|Значение
|Meaning
|-
|-
|1
|1
|0
|0
|Температура
|Temperature
|-
|-
|2
|2
|1
|1
|Старший (первый) байт уровня
|High byte of Level
|-
|-
|3
|3
|2
|2
|Младший (последний) байт уровня
|Low byte of Level
|-
|-
|4
|4
|3
|3
|Всегда 0
|Always 0
|-
|-
|5
|5
|4
|4
|Всегда 0
|Always 0
|-
|-
|6
|6
|5
|5
|Всегда 0
|Always 0
|-
|-
|7
|7
|6
|6
|Всегда 0
|Always 0
|-
|-
|8
|8
|7
|7
|Всегда 0
|Always 0
|}
|}
Baudrate не изменяется.
Baudrate does not change.


'''19200, 8, n, 1'''
'''19200, 8, n, 1'''


Количество бит в посылке 12х8 т.е около 96 шт
The number of bits in the package is 12x8, i.e. about 96 pcs


В запросе не важно какой указан сетевой номер, а также неважно количество запрашиваемых регистров. Главное, чтобы совпадала контрольная сумма. Расчет контрольной суммы приведен ниже.
The network number specified in the request is not important, and the number of requested registers is also not important. The main thing is that the checksum matches. The checksum calculation is given below.


= '''Example of TD-500 sensor polling in Terminal program''' =
= '''Example of TD-500 sensor polling in Terminal program''' =