WB-MSx Consumer IR Manual/en: различия между версиями

Нет описания правки
(Новая страница: «=== Removing all signals from permanent memory === To delete all recorded signals, write 1 to the flag register at <code>5000</code>.»)
 
(не показано 14 промежуточных версий 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. Details refer to the [[#Modbus control| Modbus control]].
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 [[#register Map|Modbus register map]].
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 ===
=== 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,
Строка 82: Строка 82:
To delete all recorded signals, write 1 to the flag register at <code>5000</code>.
To delete all recorded signals, write 1 to the flag register at <code>5000</code>.


== Карта регистров ==  
== Register map ==  


=== Карта регистров хранения (Holding Registers)===
===Holding Registers===


{| border="1" class="wikitable" style="text-align:center"
{| border="1" class="wikitable" style="text-align:center"
!Регистр/ адрес
!Register/ address
!тип
!type
!чтение/ запись
!read-write
!значение по умолчанию
!default
!формат
!format
!назначение
!appointment
|-
|-
|6
|6
|input
|input
|R
|R
|0x7FFF — датчик не подключен или неисправен
|0x7FFF — sensor not connected or defective
|°C × 16 (signed)
|°C × 16 (signed)
|Температура с внешнего датчика
|Temperature from external sensor
|-
|-
|7
|7
|input
|input
|R
|R
|0x7FFF — датчик не подключен или неисправен
|0x7FFF — sensor is not connected or defective
|°C × 16 (signed)
|°C × 16 (signed)
|Температура с внешнего датчика
|Temperature from external sensor
|-
|-
| 110 || holding || RW || 96 (0x60) || baud rate / 100 || скорость порта RS-485, '''делённая на 100'''. Допустимые скорости: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 <br>([[UART_Communication_Settings|Настройка параметров обмена данными по RS-485 для modbus-устройств Wiren Board]])
| 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 || || настройка бита чётности порта RS-485. Допустимые значения: 0 - нет бита чётности (none), 1 - нечётный (odd), 2 - чётный (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)  
|-
|-
| 112 || holding || RW || 2 || || количество стоп-битов порта RS-485. Допустимые значения: 1, 2
| 112 || holding || RW|| 2 || || number of stop bits of RS-485 port. Valid values: 1, 2
|-
|-
| 120 (0x78) || holding || RW || 0 || отличное от 0 || запись в регистр вызывает перезагрузку модуля без сохранения состояния
| 120 (0x78) || holding || RW|| 0 || non-0 || writing to the register causes the module to restart without saving state
|-
|-
| 121 (0x79) || input || R || - || mV || текущее напряжение питания модуля
| 121 (0x79) || input || R || - || mV || current supply voltage of the module
|-
|-
| 128 (0x80) || holding || RW || 1 || || Modbus-адрес устройства
| 128 (0x80) || holding || RW|| 1 || || Modbus device address
|-
|-
| 200-206 || input || R || {'x','x','x','x','x','x'} || || сигнатура
| 200-206 || input || R || {'x','x','x','x','x','x'} | | | signature
|-
|-
| 220-241 || input || R || || __date__ __time__||   дата сборки прошивки
| 220-241 || input || R | | | | _date__ _time__|| firmware build date
|-
|-
| 250-269 || input || R || ||  строка, null-terminated || версия прошивки
| 250-269 || input || R | | | / string, null-terminated || firmware version
|-
|-
| 270-271 || input || R || || 32-bit unsigned int || уникальный идентификатор (S/N)
| 270-271 || input || R|| || 32-bit unsigned int || unique identifier (S/N)
|-
|-
| 2000-2509 || holding || RW || || || Буфер периодов IR-приемопередатчика (2000-2201 в прошивках WB-MIR версий до 4.1.0)  
| 2000-2509 || holding || RW|| || || IR transceiver period Buffer (2000-2201 in WB-MIR firmware versions up to 4.1.0)  
|-
|-
|}
|}


=== Карта регистров флагов и входов (Coils и Inputs) ===
=== Map registers, flags, and inputs (Inputs and Coils) ===




{| border="1" class="wikitable" style="text-align:center"
{| border="1" class="wikitable" style="text-align:center"
!Начальный адрес || Тип || Количество || Назначение || В модификациях
!Starting address || Type || Quantity || Purpose || In modifications
|-
|-
| 5000 || coil || 1 || style="text-align:left" | Очистка всех банков ИК-команд || I
| 5000 || coil|| 1 || style="text-align:left" | Clear all IR command banks || I
|-
|-
| 5001 || coil || 1 || style="text-align:left" | Запись ИК-команды с ИК-приёмника в Modbus регистры хранения (2000-2509) (RAM), без сохранения в банк команд || I
| 5001 || coil|| 1 || style="text-align:left" | Write IR commands from IR receiver to Modbus storage registers (2000-2509) (RAM), without saving to command Bank || I
|-
|-
| 5002 || coil || 1 || style="text-align:left" | Воспроизведение ИК-команды из Modbus регистров хранения (2000-2509) (RAM) || I
| 5002 || coil|| 1 || style="text-align:left" | Play IR command from Modbus storage registers (2000-2509) (RAM) || I
|-
|-
| 5100 (в прошивке 3.1.0 и ранее - 0) || coil || number_of_banks || style="text-align:left" | Воспроизведение ИК-команды из соответствующего банка ROM (Play) || I
| 5100 (firmware 3.1.0 and earlier - 0) || coil || number_of_banks || style="text-align:left" | Play IR command from the corresponding ROM Bank (Play) || I
|-
|-
| 5200 (в прошивке 3.1.0 и ранее - 1000) || coil || number_of_banks|| style="text-align:left" | Редактирование ИК-команд (ROM) с копированием в RAM (ROM -> RAM) || I  
| 5200 (firmware 3.1.0 and earlier - 1000) || coil || number_of_banks|| style="text-align:left" | edit IR commands (ROM) with copying to RAM (ROM -> RAM) || I  
|-
|-
| 5300 (в прошивке 3.1.0 и ранее - 2000)|| coil || number_of_banks || style="text-align:left" | Запись в банк ИК-команд с использованием IR-приёмника  (Learn)|| I
| 5300 (in firmware 3.1.0 and earlier - 2000)|| coil || number_of_banks || style="text-align:left" | Write to IR command Bank using IR receiver (Learn)|| I
|-
|-
| 5400 || input || number_of_banks || style="text-align:left" | Размер данных IR-команды в байтах || I
| 5400 || input || number_of_banks || style="text-align:left" | IR command data Size in bytes || I
|-
|-
|}
|}


В последних версиях прошивок значение number_of_banks равняется 80, то есть, например, регистры размера команд имеют значения от 5400 до 5479.
In the latest firmware versions, the value of number_of_banks is 80, that is, for example, command size registers have values from 5400 to 5479.


== Управление модулем из командной строки ==
== Command-line device management ==
Программное обеспечение контроллера Wiren Board включает в себя утилиту modbus_client для работы с устройствами, подключенными к выходам RS-485, по протоколу Modbus, подробное описание команды находится на странице [[Modbus-client]]. Доступ к командной строке описан в статье [[SSH]].
The Wiren Board controller software includes  modbus_client utility to work with devices connected to the RS-485 outputs, via Modbus Protocol, the detailed description of the command is on the page [[Modbus-client/en| Modbus client]]. Access to the command line is described in [[SSH/en| SSH]].


=== Пример чтения регистров ===
=== Register reading example ===
Проверим, верно ли, что мы подключились именно к модулю нужного типа. (Модуль wb-mqtt-serial должен быть предварительно остановлен). По адресу 200 хранится уникальная сигнатура длиной в 6 регистров. Прочтем 6 регистров, начиная с адреса 200, и преобразуем полученный ответ из шестнадцатеричных цифр в символьную строку:
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 stopped). At address 200, a unique signature of 6 registers is stored. Let's read 6 registers, starting with the address 200, and convert the received answer from hexadecimal digits into a character string:


<syntaxhighlight lang="bash">echo  -e `modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 \
<syntaxhighlight lang="bash">echo  -e `modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 \
Строка 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>


В результате выполнения команды получаем строку, например '''WBMIR'''. В этом примере модуль WB-MIR имеет Modbus-адрес 1.
As a result of the command, we receive string  '''WBMIR'''. The WB-MIR module in the example has Modbus address 1.