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

Навигация

I/O Mapping Matrix/en: различия между версиями

Новая страница: «Leaving input 1 closed, turn off and turn on the relay power: after 20 minutes, relays 1, 2 and 3 will turn on again.»
(Новая страница: «Note: the relay state changes only when the input state changes.»)
(Новая страница: «Leaving input 1 closed, turn off and turn on the relay power: after 20 minutes, relays 1, 2 and 3 will turn on again.»)
 
(не показано 7 промежуточных версий этого же участника)
Строка 211: Строка 211:
Note: the relay state changes only when the input state changes.
Note: the relay state changes only when the input state changes.


==== Датчик протечки ====
==== Leak sensor ====


Пусть датчик протечки подключен ко '''входу 1''', а '''реле 1 и 2''' управляют приводами шаровых кранов. '''Реле 3''' управляет сигнальной лампой или зуммером. При смачивании датчика протечки '''реле 1 и реле 2''' замыкаются и приводы закрывают шаровые краны. '''Реле 3''' замыкается и включает зуммер. '''Вход 2''' запрограммируем для сброса тревоги и открытия шаровых кранов.
Let the leak sensor be connected to the '''input 1''', and the '''relays 1 and 2''' control the ball valve actuators. '''Relay 3''' controls the warning lamp or buzzer. When wetting the leakage sensor '''relay 1 and relay 2''' are closed and the actuators close the ball valves. '''Relay 3''' closes and switches on the buzzer. '''Input 2''' will be programmed to reset the alarm and open the ball valves.


Очистим mapping-матрицу:
Clear the mapping matrix:
<syntaxhighlight lang="bash">modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 -a1 -t0x10 -r384 $(printf ' 0%.0s' {1..64})</syntaxhighlight>
<syntaxhighlight lang="bash">modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 -a1 -t0x10 -r384 $(printf ' 0%.0s' {1..64})</syntaxhighlight>


Применим в нашем случае режим, когда состояние входа повторяется каждые 20 минут, для этого запишем в регистр 9 значение 5 (управлять в соответствии с mapping-матрицей, через 20 минут повторно имитировать состояние ввода), а в остальные значение 4 (управлять в соответствии с mapping-матрицей).
Apply in our case, the mode when the input state is repeated every 20 minutes, for this write in the register 9 value 5 (control in accordance with the mapping matrix, after 20 minutes to re-simulate the input state), and the rest the value 4 (control in accordance with the mapping matrix).


<syntaxhighlight lang="bash">modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 -a1 -t0x10 -r9 5 4 4 4 4 4</syntaxhighlight>
<syntaxhighlight lang="bash">modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 -a1 -t0x10 -r9 5 4 4 4 4 4</syntaxhighlight>


Для входа датчика протечки (вход 1) используем режим 1000 (8) — включать при замыкании. [[File:Mm_1000.png|frameless|270px]]<br> Для входа кнопки сброса (вход 2) используем режим 0100 (4) — выключить при замыкании. [[File:Mm_0100.png|frameless|270px]]<br>
To enter the leakage sensor (input 1) use the mode 1000 (8) — turn on when the circuit. [[File:Mm_1000.png|frameless|270px]]<br> To enter the reset button (input 2) use mode 0100 (4) — turn off when closing. [[File:Mm_0100.png|frameless|270px]]<br>


По карте mapping-регистров определяем, что для входа 1 надо записать значение 8 в регистры 384, 385, 386, а для входа 2 — записать значение 4 в регистры 392, 393, 394:
On the map mapping-registers we determine that to enter 1, you need to write the value 8 in the registers 384, 385, 386, and to enter 2 — write the value 4 in the registers 392, 393, 394:


<syntaxhighlight lang="bash">modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 -a1 -t0x10 -r384 8 8 8</syntaxhighlight>
<syntaxhighlight lang="bash">modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 -a1 -t0x10 -r384 8 8 8</syntaxhighlight>
Строка 230: Строка 230:




Проверка: замкнем вход 1 и iGND и оставим его замкнутым. Должны включиться реле 1, 2 и 3. Затем замкнем и разомкнем вход 2 — все три реле реле выключились. Ждем 20 минут. Поскольку вход 1 остается замкнутым (протечка не устранена), через 20 минут реле 1, 2 и 3 снова включатся.
Checking: close input 1 and iGND and leave it closed. Relays 1, 2 and 3 must be switched on. Then we close and open the input 2 — all three relay relays are off. Wait 20 minutes. Since input 1 remains closed (leakage is not eliminated), relays 1, 2 and 3 will switch back on after 20 minutes.


Оставляя вход 1 замкнутым, выключим и включим питание реле: через 20 минут реле 1, 2 и 3 снова включатся.
Leaving input 1 closed, turn off and turn on the relay power: after 20 minutes, relays 1, 2 and 3 will turn on again.
12 063

правки