Здравствуйте! Есть задача считывать состояния охранных шлейфов из ИСО Орион Болида. Используем преобразователь интерфейсов С2000-ПП версии 2.0. Мануал: https://bolid.ru/files/373/566/s2000_pp_rept_jan_21.pdf
Сейчас настроено три шлейфа сигнализации, их состояние хранится в регистрах 4096, 4112 и 4128 соответственно. Если читать их вручную через терминал- всё отлично.
Если добавить все три в конфиг вот так:
Конфиг
{
"slave_id": "1",
"id": "S2000PP",
"name": "S2000PP",
"protocol": "modbus",
"poll_interval": 1000,
"channels": [
{
"name": "ch1",
"type": "text",
"reg_type": "input",
"address": "4096",
"format": "s16",
"readonly": true,
"poll_interval": 1000
},
{
"name": "ch2",
"type": "text",
"reg_type": "input",
"address": "4112",
"format": "s16",
"readonly": true,
"poll_interval": 1000
},
{
"name": "ch3",
"type": "text",
"reg_type": "input",
"address": "4128",
"format": "s16",
"readonly": true,
"poll_interval": 1000
}
],
"device_max_fail_cycles": 0
}
То успешно читаются первый и третий регистры, второй не читается вообще, сыпет ошибками:
/var/log/messages
root@wirenboard-A2T6NRMB:~# tail -f /var/log/messages
Jun 2 19:01:02 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:03 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:04 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:05 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:05 wirenboard-A2T6NRMB CRON[21607]: pam_unix(cron:session): session closed for user root
Jun 2 19:01:06 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:07 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:08 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:09 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:10 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:11 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:12 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:13 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:14 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:15 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:16 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:17 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:18 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:01:19 wirenboard-A2T6NRMB wb-mqtt-serial[21061]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
По опыту работы с невотоном, добавил в конфиг “device_timeout_ms”: 3000 и “frame_timeout_ms”: 2500:
Конфиг
{
"slave_id": "1",
"id": "S2000PP",
"name": "S2000PP",
"protocol": "modbus",
"poll_interval": 1000,
"channels": [
{
"name": "ch1",
"type": "text",
"reg_type": "input",
"address": "4096",
"format": "s16",
"readonly": true,
"poll_interval": 1000
},
{
"name": "ch2",
"type": "text",
"reg_type": "input",
"address": "4112",
"format": "s16",
"readonly": true,
"poll_interval": 1000
},
{
"name": "ch3",
"type": "text",
"reg_type": "input",
"address": "4128",
"format": "s16",
"readonly": true,
"poll_interval": 1000
}
],
"device_max_fail_cycles": 0,
"device_timeout_ms": 3000,
"frame_timeout_ms": 2500
}
С такими настройками успешно читаются все три регистра, но в то же время они время от времени вываливаются в ошибку:
/var/log/messages
root@wirenboard-A2T6NRMB:~# tail -f /var/log/messages
Jun 2 19:04:15 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: INFO: [mqtt] subscription succeeded (message id 45)
Jun 2 19:04:15 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: INFO: [mqtt] subscription succeeded (message id 116)
Jun 2 19:04:16 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: INFO: [serial client] device modbus:209 is connected
Jun 2 19:04:21 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 coil(s) @ 0 of device modbus:209: Serial protocol error: request timed out
Jun 2 19:04:21 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:21 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: INFO: [serial client] device modbus:1 is connected
Jun 2 19:04:24 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4096 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:27 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4128 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:30 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:33 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4096 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:36 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4128 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:39 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:42 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4096 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:46 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4128 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:49 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:52 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4096 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:55 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4128 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:04:58 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4112 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:05:01 wirenboard-A2T6NRMB wb-mqtt-serial[21934]: WARNING: [modbus] failed to read 1 input(s) @ 4096 of device modbus:1: Serial protocol error: request timed out
Jun 2 19:05:01 wirenboard-A2T6NRMB CRON[21997]: pam_unix(cron:session): session opened for user root by (uid=0)
Jun 2 19:05:01 wirenboard-A2T6NRMB CRON[21996]: pam_unix(cron:session): session opened for user root by (uid=0)
Jun 2 19:05:01 wirenboard-A2T6NRMB CRON[22003]: (root) CMD (/usr/share/wb-daemon-watchdogs/check_wbrules.sh 2>&1 | logger -t wb-daemon-watchdogs)
Jun 2 19:05:01 wirenboard-A2T6NRMB CRON[22005]: (root) CMD (/usr/share/wb-daemon-watchdogs/check_confed.sh 2>&1 | logger -t wb-daemon-watchdogs)
Jun 2 19:05:03 wirenboard-A2T6NRMB CRON[21997]: pam_unix(cron:session): session closed for user root
В чём может быть дело? Сейчас всё подключено коротким отрезком Profibus, так что не думаю, что дело в коммутации. Правда, не подключена земля.
Но этот же С2000-ПП отлично читается без ошибок и земли с помощью ПО болида для ПК.