Wb-mqtt-serial templates/en: различия между версиями

Новая страница: «Option '''''protocol'': ''modbus_io''''' indicates that the device connects to the extension module via special protocol. The parameters '''"stride": 1000''' and…»
(Новая страница: «In this template, you should pay attention to the following device settings. <syntaxhighlight lang="JSON"> "protocol": "modbus_io", "stride": 1000, "s…»)
(Новая страница: «Option '''''protocol'': ''modbus_io''''' indicates that the device connects to the extension module via special protocol. The parameters '''"stride": 1000''' and…»)
Строка 431: Строка 431:
</syntaxhighlight>
</syntaxhighlight>


Параметр '''"protocol": "modbus_io"''' указывает, что устройство подключается оп специальному протоколу к модулю расширения. Параметры '''"stride": 1000''' и '''"shift": 500''' задают сдвиг регистров в зависимости от того, в каком порядке подключены модули к модулю расширения.  
Option '''''protocol'': ''modbus_io''''' indicates that the device connects to the extension module via special protocol. The parameters '''"stride": 1000''' and '''"shift":500''' set the shift of registers depending on the order in which the modules are connected to the extension module.  


Сдвиг регистров (число, которое нужно добавить к базовому номеру регистра) вычисляется по формуле: <syntaxhighlight lang="C++">Shift = (((SlaveId.Secondary - 1) % 4) + 1) * DeviceConfig()->Stride + DeviceConfig()->Shift;</syntaxhighlight> Здесь stride — ''DeviceConfig()->Stride'', a shift — ''DeviceConfig()->Shift''. Каждое подключенное устройство имеет порядковый номер (''SlaveId.Secondary''), начинающийся с 1 для первого устройства. (Здесь знаком "%" обозначается деление по модулю.)
Сдвиг регистров (число, которое нужно добавить к базовому номеру регистра) вычисляется по формуле: <syntaxhighlight lang="C++">Shift = (((SlaveId.Secondary - 1) % 4) + 1) * DeviceConfig()->Stride + DeviceConfig()->Shift;</syntaxhighlight> Здесь stride — ''DeviceConfig()->Stride'', a shift — ''DeviceConfig()->Shift''. Каждое подключенное устройство имеет порядковый номер (''SlaveId.Secondary''), начинающийся с 1 для первого устройства. (Здесь знаком "%" обозначается деление по модулю.)
12 063

правки