Создал шаблон своего устройства Modbus. Если опрашивать по одному регистру, все корректно считывается.
Пытаюсь сделать групповой запрос 6 регистров. Запрос формируется корректно, устройство отвечает, но в данных устройства отображается только первый параметр, остальные красным цветом и не меняются.
Групповой запрос на 3 регистра - данные в устройстве актуальны для 4 регистров, последние 2 - красным цветом.
Конфиг wb-serial:
{
"debug" : true,
"max_unchanged_interval" : 0,
"ports" :
[
{
"baud_rate" : 115200,
"data_bits" : 8,
"devices" :
[
{
"channels" :
[
{
"name" : "Hardware version",
"read_period_ms" : 2000
},
{
"name" : "Main power",
"read_period_ms" : 2000
},
{
"name" : "Motor power",
"read_period_ms" : 2000
},
{
"name" : "Reserve",
"read_period_ms" : 2000
},
{
"name" : "Motor voltage output ",
"read_period_ms" : 2000
},
{
"name" : "Motor current output ",
"read_period_ms" : 2000
}
],
"device_type" : "rwd",
"enabled" : true,
"min_read_registers" : 3,
"name" : "RWD surface",
"slave_id" : "128"
}
],
"enabled" : true,
"guard_interval_us" : 10,
"parity" : "N",
"path" : "/dev/ttyRS485-1",
"poll_interval" : 0,
"port_type" : "serial",
"response_timeout_ms" : 500,
"stop_bits" : 1
},
{
"baud_rate" : 9600,
"data_bits" : 8,
"devices" : [],
"enabled" : false,
"parity" : "N",
"path" : "/dev/ttyRS485-2",
"port_type" : "serial",
"read_rate_limit_ms" : 0,
"stop_bits" : 2
},
{
"baud_rate" : 9600,
"data_bits" : 8,
"devices" : [],
"enabled" : false,
"parity" : "N",
"path" : "/dev/ttyMOD1",
"stop_bits" : 2
},
{
"baud_rate" : 9600,
"data_bits" : 8,
"devices" : [],
"enabled" : false,
"parity" : "N",
"path" : "/dev/ttyMOD2",
"stop_bits" : 2
},
{
"baud_rate" : 9600,
"data_bits" : 8,
"devices" : [],
"enabled" : false,
"parity" : "N",
"path" : "/dev/ttyMOD3",
"stop_bits" : 2
},
{
"baud_rate" : 9600,
"data_bits" : 8,
"devices" : [],
"enabled" : false,
"parity" : "N",
"path" : "/dev/ttyMOD4",
"stop_bits" : 2
}
],
"rate_limit" : 1
}
Лог
|26-02-2024 10:57:51.960|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536004633: Wait until 2536005781|
|---|---|
|26-02-2024 10:57:51.869|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536004533: Wait until 2536005781|
|26-02-2024 10:57:51.768|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536004433: Wait until 2536005781|
|26-02-2024 10:57:51.645|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536004333: Wait until 2536005781|
|26-02-2024 10:57:51.544|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536004232: Wait until 2536005781|
|26-02-2024 10:57:51.445|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536004132: Wait until 2536005781|
|26-02-2024 10:57:51.344|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536004032: Wait until 2536005781|
|26-02-2024 10:57:51.244|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536003932: Wait until 2536005781|
|26-02-2024 10:57:51.144|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536003832: Wait until 2536005781|
|26-02-2024 10:57:51.144|DEBUG: [port] /dev/ttyRS485-1: ReadFrame: 80 03 0c 00 00 00 01 00 02 00 03 00 04 00 06 79 83|
|26-02-2024 10:57:51.094|DEBUG: [port] /dev/ttyRS485-1: Sleep 695 us|
|26-02-2024 10:57:51.093|DEBUG: [port] /dev/ttyRS485-1: Write: 80 03 00 00 00 06 db d9|
|26-02-2024 10:57:51.093|DEBUG: [port] /dev/ttyRS485-1: Sleep 10 us|
|26-02-2024 10:57:51.045|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536003733: Wait until 2536003781|
|26-02-2024 10:57:50.945|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536003633: Wait until 2536003781|
|26-02-2024 10:57:50.856|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536003533: Wait until 2536003781|
|26-02-2024 10:57:50.745|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536003433: Wait until 2536003781|
|26-02-2024 10:57:50.645|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536003333: Wait until 2536003781|
|26-02-2024 10:57:50.545|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536003232: Wait until 2536003781|
|26-02-2024 10:57:50.445|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536003132: Wait until 2536003781|
|26-02-2024 10:57:50.344|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536003032: Wait until 2536003781|
|26-02-2024 10:57:50.245|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536002932: Wait until 2536003781|
|26-02-2024 10:57:50.144|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536002832: Wait until 2536003781|
|26-02-2024 10:57:50.044|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536002732: Wait until 2536003781|
|26-02-2024 10:57:49.944|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536002632: Wait until 2536003781|
|26-02-2024 10:57:49.858|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536002532: Wait until 2536003781|
|26-02-2024 10:57:49.744|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536002431: Wait until 2536003781|
|26-02-2024 10:57:49.644|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536002331: Wait until 2536003781|
|26-02-2024 10:57:49.543|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536002231: Wait until 2536003781|
|26-02-2024 10:57:49.443|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536002131: Wait until 2536003781|
|26-02-2024 10:57:49.343|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536002031: Wait until 2536003781|
|26-02-2024 10:57:49.243|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536001931: Wait until 2536003781|
|26-02-2024 10:57:49.143|DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>2536001831: Wait until 2536003781|
|26-02-2024 10:57:49.143|DEBUG: [port] /dev/ttyRS485-1: ReadFrame: 80 03 0c 00 00 00 01 00 02 00 03 00 04 00 06 79 83|
|26-02-2024 10:57:49.094|DEBUG: [port] /dev/ttyRS485-1: Sleep 695 us|
|26-02-2024 10:57:49.094|DEBUG: [port] /dev/ttyRS485-1: Write: 80 03 00 00 00 06 db d9|
|26-02-2024 10:57:49.093|DEBUG: [port] /dev/ttyRS485-1: Sleep 10 us|