Перейти к содержанию

Навигация

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

Новая страница: « For example, substituting the values of shift and stride in the formula: <syntaxhighlight lang="C++">Shift = ((( 1 - 1) % 4) + 1) * 500 + 1000 = (0 + 1) * 500 +…»
(Новая страница: « Shift = (((SlaveId.Secondary - 1) % 4) + 1) * DeviceConfig()->Stride + DeviceConfig()->Shift; Here stride — DeviceConfig()->Stride, a shift — DeviceConfig()-…»)
(Новая страница: « For example, substituting the values of shift and stride in the formula: <syntaxhighlight lang="C++">Shift = ((( 1 - 1) % 4) + 1) * 500 + 1000 = (0 + 1) * 500 +…»)
Строка 439: Строка 439:
Register shift (the number to be added to the base register number) is calculated by the formula:<syntaxhighlight lang="C++">Shift = (((SlaveId.Secondary - 1) % 4) + 1) * DeviceConfig()->Stride + DeviceConfig()->Shift;</syntaxhighlight> Здесь stride — ''DeviceConfig()->Stride'', a shift — ''DeviceConfig()->Shift''. Each connected device has a serial number (''SlaveId.Secondary'') starting with 1 for the first device. (Here the sign "%" shows modulу division.)
Register shift (the number to be added to the base register number) is calculated by the formula:<syntaxhighlight lang="C++">Shift = (((SlaveId.Secondary - 1) % 4) + 1) * DeviceConfig()->Stride + DeviceConfig()->Shift;</syntaxhighlight> Здесь stride — ''DeviceConfig()->Stride'', a shift — ''DeviceConfig()->Shift''. Each connected device has a serial number (''SlaveId.Secondary'') starting with 1 for the first device. (Here the sign "%" shows modulу division.)


Например, подставляя значения shift и stride в формулу, получаем: <syntaxhighlight lang="C++">Shift = ((( 1 - 1) % 4) + 1) * 500 + 1000 = (0 + 1) * 500 + 1000 = 1500</syntaxhighlight> То есть ко всем регистрам, указанным в шаблоне, надо добавить 1500.
 
For example, substituting the values of shift and stride in the formula: <syntaxhighlight lang="C++">Shift = ((( 1 - 1) % 4) + 1) * 500 + 1000 = (0 + 1) * 500 + 1000 = 1500</syntaxhighlight> So, you need to add 1500 to all registers specified in the template.


Еще один важный параметр — setup-секция, массив  
Еще один важный параметр — setup-секция, массив  
12 063

правки