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

Новая страница: «==== Playback of a signal from ROM ==== To play back the signal number <code>i</code> from memory, write 1 to the flag register at <code>5100 + i</code>. If the s…»
(Новая страница: «To write the signal number <code>i</code> from the remote control to memory, write 1 to the flag register at <code>5300 + i</code>. Then point the remote control…»)
(Новая страница: «==== Playback of a signal from ROM ==== To play back the signal number <code>i</code> from memory, write 1 to the flag register at <code>5100 + i</code>. If the s…»)
Строка 53: Строка 53:
</syntaxhighlight>
</syntaxhighlight>


==== Воспроизведение сигнала из постоянной памяти ====
==== Playback of a signal from ROM ====
Чтобы воспроизвести сигнал под номером <code>i</code> из памяти, запишите 1 в регистр флага по адресу <code>5100 + i</code>. Если сигнал под номером <code>i</code> не был записан ранее, будет возвращена ошибка. Пока идёт воспроизведение сигнала, регистр флага по адресу <code>5100 + i</code> будет установлен в 1, а затем сам установится в 0. Пока идёт воспроизведение сигнала, никакие другие операции с ИК-приёмопередатчиком по Modbus не будут доступны.
To play back the signal number <code>i</code> from memory, write 1 to the flag register at <code>5100 + i</code>. If the signal number <code>i</code> has not been recorded before, an error will be returned. While the signal is playing, the flag register at <code>5100 + i</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.
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
#Отдаём команду воспроизвести сигнал с номером 1. Устройство подключено к порту /dev/ttyRS485-1 и имеет Modbus-адрес 16
#Give the command to play the signal with the number 1. The device connected to port /dev/ttyRS485-1 has Modbus 16
root@wirenboard:~# modbus_client --debug -m rtu -b9600 -s2 -pnone /dev/ttyRS485-1 -a16 -t5 -r5101 1
root@wirenboard:~# modbus_client --debug -m rtu -b9600 -s2 -pnone /dev/ttyRS485-1 -a16 -t5 -r5101 1
</syntaxhighlight>
</syntaxhighlight>
==== Редактирование сигнала в постоянной памяти ====
==== Edit the signal in ROM ====
Чтобы отредактировать сигнал под номером <code>i</code> или записать его по Modbus (без пульта ДУ), запишите 1 в регистр флага по адресу <code>5200 + i</code>. После этого сигнал в виде последовательности натуральных чисел (смотрите рисунок "Пример содержимого оперативного буфера WB-MIR") будет записан в подряд идущие регистры хранения, начиная с регистра <code>2000</code>. В конце последовательности будут два подряд идущих регистра хранения, содержащих 0. Если сигнал под номером <code>i</code> не был записан ранее, в регистрах хранения <code>2000</code> и <code>2001</code> будут находиться 0. Для внесения изменений в последовательность (в том числе для записи команды по Modbus) нужно записать правильную последовательность в данные регистры хранения с помощью команд <code>WRITE_SINGLE_REGISTER</code> и <code>WRITE_MULTI_REGISTERS</code>. В конце изменённой последовательности всё также должен быть маркер конца последовательности - два подряд идущих регистра хранения, содержащих 0. Чтобы удалить сигнал, запишите в первые два регистра хранения (<code>2000</code> и <code>2001</code>) 0. После окончания редактирования запишите 0 в регистр флагов по адресу <code>5200 + i</code>. До тех пор пока в регистре флагов по адресу <code>5200 + i</code> не будет стоять 0, никакие другие операции, в том числе и над другими сигналами, не будут доступны.
To edit the signal number <code>i</code> or record it via Modbus (without remote control), write 1 in the flag register at <code>5200 + i</code>. After that, the signal in the form of a sequence of natural numbers (see the figure "Example of the contents of the WB-MIR operational buffer") will be written to the consecutive storage registers, starting with the register <code>2000</code>. At the end of the sequence there will be two consecutive storage registers containing 0. If the signal number <code>i</code> has not been recorded before, the storage registers <code>2000</code> and <code>2001</code> will contain 0. To make changes to the sequence (including writing a Modbus command), you must write the correct sequence to the storage registers using the <code>WRITE_SINGLE_REGISTER</code> and <code>WRITE_MULTI_REGISTERS</code>commands. At the end of the modified sequence, there must also be an end-of-sequence marker - two consecutive storage registers containing 0. To remove the signal, write 0 in the first two storage registers (<code>2000</code> and <code>2001</code>). After editing, write 0 in the flag register at <code>5200 + i</code>. Until the flags register at the address <code>5200 + i</code> will not be a 0, no other operations, including over other signals will not be available.


==== Удаление всех сигналов из постоянной памяти ====
==== Удаление всех сигналов из постоянной памяти ====
12 063

правки