2482
правки
(Новая страница: «=== Register reading example === Let's check whether it is true that we are connected to the module of the desired type. (Module wb-mqtt-serial needs to be stoppe…») |
Admin (обсуждение | вклад) |
||
(не показано 6 промежуточных версий 1 участника) | |||
Строка 28: | Строка 28: | ||
'''Warning!''' Numbers used Modbus registers have changed since firmware version '''3.2.0'''. The instructions stated the new numbers of registers. If you are using a device with older firmware, the general principle remains the same, but the numbers of the registers are shifted; as it is — see the [[#Map registers, flags, and inputs (Inputs and Coils)|Map registers, flags, and inputs (Coils and Inputs)]]. A full description of IR device registers can be found in this article under [[#Register map|Register map]]. | '''Warning!''' Numbers used Modbus registers have changed since firmware version '''3.2.0'''. The instructions stated the new numbers of registers. If you are using a device with older firmware, the general principle remains the same, but the numbers of the registers are shifted; as it is — see the [[#Map registers, flags, and inputs (Inputs and Coils)|Map registers, flags, and inputs (Coils and Inputs)]]. A full description of IR device registers can be found in this article under [[#Register map|Register map]]. | ||
At the physical level, the module is connected via [[RS-485/en| RS-485]] interface. Modbus RTU Protocol is used to control the devices. In Wiren Board devices, Modbus data is transmitted over RS-485 communication lines. See the [[Протокол Modbus/en|Modbus Protocol]] page for details. Modbus-address of the device is set at the factory and marked on the label. The address can be changed programmatically | At the physical level, the module is connected via [[RS-485/en| RS-485]] interface. Modbus RTU Protocol is used to control the devices. In Wiren Board devices, Modbus data is transmitted over RS-485 communication lines. See the [[Протокол Modbus/en|Modbus Protocol]] page for details. Modbus-address of the device is set at the factory and marked on the label. The address can be changed programmatically. | ||
In devices with firmware version "'3.1.0"' and later it is also possible to change the settings of data exchange parameters — see [[# | In devices with firmware version "'3.1.0"' and later it is also possible to change the settings of data exchange parameters — see [[#Register map|Modbus register map]]. | ||
The control of the IR receiver is made through the flags of Modbus registers; a full list can be found in the description of the map registers. There are 3 types of operations with signals: | The control of the IR receiver is made through the flags of Modbus registers; a full list can be found in the description of the map registers. There are 3 types of operations with signals: | ||
Строка 68: | Строка 68: | ||
=== Recording the signal to the RAM from the remote control === | === Recording the signal to the RAM from the remote control === | ||
To write a signal (only one) from the remote control to the RAM without putting it in the ROM - write 1 in the flag register at <code>5001</code>. Further actions occur in the same way as described above to record the signal in ROM. After the recording is stopped in the storage registers at <code>2000</code>, the signal will be stored as a sequence of numbers. You can edit this sequence as described above. Note: the contents of these storage registers are not stored when the device is powered off! | To write a signal (only one) from the remote control to the RAM without putting it in the ROM - write 1 in the flag register at <code>5001</code>. Further actions occur in the same way as described above to record the signal in ROM. After the recording is stopped in the storage registers at <code>2000</code>, the signal will be stored as a sequence of numbers. You can edit this sequence as described above. Note: the contents of these storage registers are not stored when the device is powered off! | ||
=== Playing a signal from memory === | |||
To play the signal from memory, write 1 to the flag register at <code>5002</code>. The signal recorded in the storage registers starting with <code>2000</code>will be played. In the absence of the marker of the end of the command will return an error. While the signal is playing, the flag register at <code>5002</code> will be set to 1 and then set to 0. While the signal is being played, no other operations with the IR transceiver via Modbus will be available. | To play the signal from memory, write 1 to the flag register at <code>5002</code>. The signal recorded in the storage registers starting with <code>2000</code>will be played. In the absence of the marker of the end of the command will return an error. While the signal is playing, the flag register at <code>5002</code> will be set to 1 and then set to 0. While the signal is being played, no other operations with the IR transceiver via Modbus will be available. | ||
The control of the IR receiver is made through the Modbus registers flags (a full list can be found in [[#Coils|Coils]]). There are 3 types of operations with signals: | The control of the IR receiver is made through the Modbus registers flags (a full list can be found in [[#Map registers, flags, and inputs (Inputs and Coils)|Inputs and Coils]]). There are 3 types of operations with signals: | ||
* entry signal in the memory with the remote control, | * entry signal in the memory with the remote control, | ||
* play a signal from memory, | * play a signal from memory, | ||
Строка 108: | Строка 108: | ||
|Temperature from external sensor | |Temperature from external sensor | ||
|- | |- | ||
| 110 || holding || RW || 96 (0x60) || baud rate / 100 || RS-485 port speed, "'divided by 100"'. Permissible speeds: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 <br>([[UART_Communication_Settings|configure RS-485 communication parameters for wiren Board modbus devices]]) | | 110 || holding || RW || 96 (0x60) || baud rate / 100 || RS-485 port speed, "'divided by 100"'. Permissible speeds: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 <br>([[UART_Communication_Settings/en|configure RS-485 communication parameters for wiren Board modbus devices]]) | ||
|- | |- | ||
| 111 || holding || RW|| 0 || || configure the RS-485 port parity bit. Valid values: 0 - no parity bit (none), 1 - odd (odd), 2 - even (even) | | 111 || holding || RW|| 0 || || configure the RS-485 port parity bit. Valid values: 0 - no parity bit (none), 1 - odd (odd), 2 - even (even) | ||
Строка 166: | Строка 166: | ||
grep Data | sed -e 's/0x00/\\\x/g' -e 's/Data://' -e 's/\s//g'` </syntaxhighlight> | grep Data | sed -e 's/0x00/\\\x/g' -e 's/Data://' -e 's/\s//g'` </syntaxhighlight> | ||
As a result of the command, we receive string '''WBMIR'''. The WB-MIR module in the example has Modbus address 1. |