Relay Module Modbus Management/en: различия между версиями
(Новая страница: «Relay Modules Modbus Management») |
Admin (обсуждение | вклад) |
||
(не показано 56 промежуточных версий 3 участников) | |||
Строка 1: | Строка 1: | ||
<languages/> | <languages/> | ||
{{DISPLAYTITLE:Управление модулями реле | <!-- {{DISPLAYTITLE:Управление модулями реле Wiren Board по протоколу Modbus}} --> | ||
{{:Modbus_control_common}} | |||
=== | == Device Setup == | ||
=== | === Safe mode === | ||
In this mode, when the Modbus communication is terminated, the device disconnects the relay after a specified time. | |||
To enable Safety timer, you must write a value other than 0 to the storage register with the WRITE_SINGLE_REGISTER command at 8. This value is a timeout in seconds. A value of "0" disables safe mode. | |||
=== | ===Relay operation in case of power failure === | ||
In the latest firmware versions (starting with 1.5.3) for WB-MR devices, it is now possible to remember the output status when power is off. The mode is controlled by the Modbus register 6. If the register is set to '0', the state of the outputs will not be saved and all relays will be switched off when power is supplied. If the entry in the register unit, when the power is resumed everything is included before the crash relay is switched on again. | |||
=== | === Digital inputs === | ||
The input state can be obtained by reading the Discrete Inputs 0—'''x''' registers (where x = '''(number of managed channels - 1)'''). If the input is connected to GND, the register value is 1, if not connected - it's 0. | |||
=== Modes of interaction between digital inputs and relay outputs === | |||
You can enable direct control of the relay outputs from the digital inputs in the relay module. There are several options for such management: | |||
* Simple: | |||
** '''Mode 0''': managing switch without detent (click "self-released back"). You press the button (close the digital input with GND), it is "pressed back", the relay state is switched to the opposite. | |||
** '''Mode 1''': switch control with locking. The relay is always set according to the position of the switch. If the switch is "on" (closes the digital input with GND), the relay is also closed. If the switch is "off", the relay is open. | |||
** '''Mode 3''': relay output control from digital input is disabled. | |||
* Complex: | |||
** '''Mapping-matrix''' (see detailed description below) | |||
The mode set separately for each channel. To select mode, write mode number to corresponding holding register, starting with register 9 for the first channel etc. You should keep default value in register 5. | |||
There could be no registers 9 etc. in outdated firmware. You can only set mode for all their channels at once. To do so, write corresponding number to holding register 5. | |||
==== Mapping-matrix ==== | |||
Starting from firmware v.1.9.0, '''mode 2''' is also provided for individual channels-disable all outputs, and '''operating modes (4 and 5)''' in accordance with the mapping matrix (see below).In this and later versions of firmware versions modules have flexible settings of the interaction of inputs and outputs of relay modules using a special mapping matrix: a table in which for each input is encoded change of any relay output state when the state of this input changes. A detailed description can be found in [[I/O_Mapping_Matrix/en|I/O Mapping Matrix]]. | |||
== | = Relay module register card = | ||
In table: | |||
* '''x''' — number of relay outputs; | |||
* '''y''' — number of digital inputs. | |||
For outdated WB-MRM2 devices (not to be confused with modern WB-MRM2-mini) find register card on separate page [[WB-MRM2]]. | |||
{| border="1" class="wikitable" style="text-align:center; width:1000px;" | |||
!Register / address | |||
!Type | |||
!Read-write | |||
!Default | |||
!Format | |||
!Appointment | |||
!Note | |||
{| | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
|- | |- | ||
| 0 .. ('''x'''-1) || coil || RW || - || 1 | | 0 .. ('''x'''-1) || coil || RW|| - || 1 or 0|| relay status with number 1 .. '''x''' || | ||
|- | |- | ||
| 0 .. ('''y'''-1) || discrete || R || - || | | 0 .. ('''y'''-1) || discrete || R|| - || 1 or 0 | ||
|| | || entry status with number 1 .. '''y''' || | ||
|- | |- | ||
| 5 | | 5 | ||
Строка 67: | Строка 61: | ||
| 0 | | 0 | ||
| style="text-align:left;" | | | style="text-align:left;" | | ||
default value should be kept | |||
|| not used in modern firmware.<br>In outdated versions of firmware was used to set mode of interaction of digital inputs with relay outputs for all inputs at once. | |||
|| not used in modern firmware.<br>In outdated versions of firmware was used to set mode of interaction of digital inputs with relay outputs for all inputs at once. Configuration values were the same as now used in registers 9 .. (9+'''x'''-1), but applied to all inputs at once. | |||
|| | |||
|- | |- | ||
| 6 | | 6 | ||
|| holding || RW || 0 | | || holding || RW || 0 | | ||
| style="text-align:left;" | | | style="text-align:left;" | | ||
* '''0''': | * '''0''': do not restore relay state after power is restored | ||
* '''1''': | * '''1''': restore relay state after power is restored | ||
|| | || relay operation mode in case of power failure || (only in firmware 1.5.3 and later) | ||
|- | |- | ||
| 8 || holding || RW || 0 || | | 8 || holding || RW|| 0 || seconds || safe mode timeout || | ||
|- | |- | ||
Строка 87: | Строка 80: | ||
| rowspan="2" | 0 | | rowspan="2" | 0 | ||
| style="text-align:left;" | | | style="text-align:left;" | | ||
* '''0''': | * '''0''': non-locking buttons | ||
* '''1''': | * '''1''': switch with lock | ||
* '''3''': | * '''3''': disable interaction | ||
| rowspan="3" | | rowspan="3" | mode of interaction between digital input and corresponding relay output.<br>There should be default value in register 5 | ||
| | | | ||
|- | |- | ||
Строка 97: | Строка 89: | ||
| rowspan="2" style="text-align:left;" | | | rowspan="2" style="text-align:left;" | | ||
* '''2''': | * '''2''': disable all relays when pressed | ||
* '''4''': | * '''4''': to operate in accordance with the [[I/O_Mapping_Matrix/en|I/O mapping- matrix]] | ||
* '''5''': | * '''5''': to operate in accordance with the [[I/O_Mapping_Matrix/en|I/O mapping-matrix]], after 20 minutes to re-simulate the input state | ||
| | |Since firmware v.1.9.0 | ||
|- | |- | ||
|1 | |1 | ||
| | |Since firmware v.1.12.0 | ||
|- | |- | ||
Строка 111: | Строка 103: | ||
| | | | ||
|style="text-align:left;"| | |style="text-align:left;"| | ||
* '''0''': | * '''0''': non-locking button | ||
* '''1''': | * '''1''': switch with lock | ||
* '''3''': | * '''3''': disable interaction | ||
| | | digital input operating mode 0 to disable all relays | ||
| | | | ||
|- | |- | ||
Строка 121: | Строка 113: | ||
|style="text-align:left;" | | |style="text-align:left;" | | ||
* '''2''': | * '''2''': disable all relays when pressed | ||
* '''4''': | * '''4''': to operate in accordance with the [[I/O_Mapping_Matrix/en|mapping-matrix]] | ||
* '''5''': | * '''5''': to operate in accordance with the [[I/O_Mapping_Matrix/en|mapping-matrix]], after 20 minutes to re-simulate the input state | ||
| | | digital input mode 0; register 5 must be set to "0" | ||
| | |Since firmware 1.9.0 | ||
|- | |- | ||
| 20 .. (20+'''x'''-1) || holdreg || RW || 50 || 0 - 100 || debouncing time in ms || Since firmware 1.13.0 | |||
| | |||
|- | |- | ||
| 32 .. (32+'''y'''-1) || input || R|| 0 || 16-bit unsigned int || input counter 1 .. '''y''' || | |||
|- | |- | ||
| 384-447 || holding || RW || 0 || || [[I/O_Mapping_Matrix|Mapping Matrix]] registers || Since firmware 1.9.0 | |||
| | |||
| | |||
| | |||
| | |||
| | |||
| | |||
| | |||
| | |||
| | |||
| | |||
| | |||
| | |||
| | |||
| | |||
|} | |} | ||
{{:Common_Modbus_Registers}} | |||
Registers for setting data exchange parameters for RS-485 are supported since firmware 1.6.0. |
Текущая версия на 23:09, 18 апреля 2020
Device Setup
Safe mode
In this mode, when the Modbus communication is terminated, the device disconnects the relay after a specified time.
To enable Safety timer, you must write a value other than 0 to the storage register with the WRITE_SINGLE_REGISTER command at 8. This value is a timeout in seconds. A value of "0" disables safe mode.
Relay operation in case of power failure
In the latest firmware versions (starting with 1.5.3) for WB-MR devices, it is now possible to remember the output status when power is off. The mode is controlled by the Modbus register 6. If the register is set to '0', the state of the outputs will not be saved and all relays will be switched off when power is supplied. If the entry in the register unit, when the power is resumed everything is included before the crash relay is switched on again.
Digital inputs
The input state can be obtained by reading the Discrete Inputs 0—x registers (where x = (number of managed channels - 1)). If the input is connected to GND, the register value is 1, if not connected - it's 0.
Modes of interaction between digital inputs and relay outputs
You can enable direct control of the relay outputs from the digital inputs in the relay module. There are several options for such management:
- Simple:
- Mode 0: managing switch without detent (click "self-released back"). You press the button (close the digital input with GND), it is "pressed back", the relay state is switched to the opposite.
- Mode 1: switch control with locking. The relay is always set according to the position of the switch. If the switch is "on" (closes the digital input with GND), the relay is also closed. If the switch is "off", the relay is open.
- Mode 3: relay output control from digital input is disabled.
- Complex:
- Mapping-matrix (see detailed description below)
The mode set separately for each channel. To select mode, write mode number to corresponding holding register, starting with register 9 for the first channel etc. You should keep default value in register 5.
There could be no registers 9 etc. in outdated firmware. You can only set mode for all their channels at once. To do so, write corresponding number to holding register 5.
Mapping-matrix
Starting from firmware v.1.9.0, mode 2 is also provided for individual channels-disable all outputs, and operating modes (4 and 5) in accordance with the mapping matrix (see below).In this and later versions of firmware versions modules have flexible settings of the interaction of inputs and outputs of relay modules using a special mapping matrix: a table in which for each input is encoded change of any relay output state when the state of this input changes. A detailed description can be found in I/O Mapping Matrix.
Relay module register card
In table:
- x — number of relay outputs;
- y — number of digital inputs.
For outdated WB-MRM2 devices (not to be confused with modern WB-MRM2-mini) find register card on separate page WB-MRM2.
Register / address | Type | Read-write | Default | Format | Appointment | Note |
---|---|---|---|---|---|---|
0 .. (x-1) | coil | RW | - | 1 or 0 | relay status with number 1 .. x | |
0 .. (y-1) | discrete | R | - | 1 or 0 | entry status with number 1 .. y | |
5 | holding | RW | 0 |
default value should be kept |
not used in modern firmware. In outdated versions of firmware was used to set mode of interaction of digital inputs with relay outputs for all inputs at once. |
not used in modern firmware. In outdated versions of firmware was used to set mode of interaction of digital inputs with relay outputs for all inputs at once. Configuration values were the same as now used in registers 9 .. (9+x-1), but applied to all inputs at once. |
6 | holding | RW |
|
relay operation mode in case of power failure | (only in firmware 1.5.3 and later) | |
8 | holding | RW | 0 | seconds | safe mode timeout | |
9 .. (9+x-1) | holding | RW | 0 |
|
mode of interaction between digital input and corresponding relay output. There should be default value in register 5 |
|
|
Since firmware v.1.9.0 | |||||
1 | Since firmware v.1.12.0 | |||||
16 | holding | RW |
|
digital input operating mode 0 to disable all relays | ||
2 |
|
digital input mode 0; register 5 must be set to "0" | Since firmware 1.9.0 | |||
20 .. (20+x-1) | holdreg | RW | 50 | 0 - 100 | debouncing time in ms | Since firmware 1.13.0 |
32 .. (32+y-1) | input | R | 0 | 16-bit unsigned int | input counter 1 .. y | |
384-447 | holding | RW | 0 | Mapping Matrix registers | Since firmware 1.9.0 |
Внимание: Отображаемое название «Таблица общих регистров» переопределяет ранее заданное отображаемое название «Relay Modules Modbus Management».
Адрес | Параметры регистра | Описание | Значения | Примечание | |||
---|---|---|---|---|---|---|---|
Dec | Hex | Тип | Доступ | Формат | |||
Параметры подключения | |||||||
110 | 0x006E | Holding | RW | u16 | Скорость порта RS-485. Настройка параметров подключения по RS-485 |
x100, Боды 12 — 1200 бит/с, 24 — 2400 бит/с, 48 — 4800 бит/с, 96 — 9600 бит/с, 192 — 19 200 бит/с, 384 — 38 400 бит/с, 576 — 57 600 бит/с, 1152 — 115 200 бит/с |
|
111 | 0x006F | Holding | RW | u16 | Настройка бита чётности порта RS-485 | 0 — нет бита чётности (none), 1 — нечётный (odd), 2 — чётный (even) |
|
112 | 0x0070 | Holding | RW | u16 | Количество стоп-битов порта RS-485 | 1, 2 | |
128 | 0x0080 | Holding | RW | u16 | Modbus-адрес устройства (подробнее) | ||
Модель устройства и версия прошивки | |||||||
200-205 | 0x00C8 - 0x00CD | Input | RO | string | Модель устройства | ||
206-219 | 0x00CE - 0x00DB | Input | RO | string | Расширение модели устройства. | Для чтения модели устройства нужно читать диапазон из 20 регистров (200 - 219) | Только в версиях прошивок, где есть Быстрый Modbus |
220-248 | 0x00DC - 0x00F8 | Input | RO | string | Хэш коммита и название ветки откуда собрана прошивка (2 символа в регистре) | ||
250-265 | 0x00FA - 0x0109 | Input | RO | string | Версия прошивки | ||
266-269 | 0x010A - 0x010D | Input | RO | u64 | Расширение серийного номера | ||
270-271 | 0x010E - 0x010F | Input | RO | u32 | Серийный номер | ||
290-301 | 0x0122 - 0x012D | Holding | RO | string | Сигнатура прошивки | ||
320 | 0x0140 | Input | RO | u16 | Версия прошивки в числовом формате (подробнее) | MAJOR | Только в версиях прошивок, где есть Быстрый Modbus |
321 | 0x0141 | MINOR | |||||
322 | 0x0142 | PATCH | |||||
323 | 0x0143 | s16 | SUFFIX | ||||
324-325 | 0x0144 - 0x0145 | Input | RO | u32 | Версия прошивки в числовом формате | Только в версиях прошивок, где есть Быстрый Modbus | |
326-327 | 0x0146 - 0x0147 | Input | RO | u32 | Версия прошивки в Big Endian формате | Только в версиях прошивок, где есть Быстрый Modbus | |
Прочее | |||||||
104-105 | 0x0068 - 0x0069 | Input | RO | u32 | Время работы с момента загрузки | секунды | |
120 | 0x0078 | Holding | RW | u16 | Перезагрузка устройства без сохранения состояния | любое, отличное от 0 перезагружает устройство | |
123 | 0x007B | Input | RO | u16 | Напряжение на микроконтроллере | мВ | |
129 | 0x0081 | Holding | RW | u16 | Перевод в режим обновления прошивки на 2 минуты | любое, отличное от 0 переводит устройство в режим обновления прошивки | |
330-336 | 0x014A - 0x0150 | Holding | RO | string | Версия загрузчика | ||
131 | 0x0083 | Holding | RW | u16 | Перевод в режим обновления прошивки на текущих настройках соединения | запись 1 переводит устройство в режим обновления прошивки | |
113 | 0x0071 | Holding | RW | u16 | Время перед отправкой ответа на modbus запрос | 0 - 254 мс | Только в версиях прошивок, где есть Быстрый Modbus |
114 | 0x0072 | Holding | RW | u16 | Режим непрерывного чтения регистров с зазором | 0 - отключен 1 - включен 2 - включение сохраняется после перезагрузки |
Только в версиях прошивок, где есть Быстрый Modbus |
121 | 0x0079 | Input | RO | u16 | Текущее напряжение питания | мВ | |
122 | 0x007A | Input | RO | u16 | Минимальное зарегистрированное напряжение питания с момента загрузки | мВ | |
123 | 0x007B | Input | RO | u16 | Напряжение питания микроконтроллера | мВ | |
124 | 0x007C | Input | RO | u16 | Внутренняя температура микроконтроллера | x0.1, °C |
Registers for setting data exchange parameters for RS-485 are supported since firmware 1.6.0.