16.03.2020, 18:24
(16.03.2020, 11:16)admin Wrote: You still haven't provided full profile that you are using for reading registers. You can also test using second RS-485 port if there's a hardware issue of some sort.
Another thing to try is to read register data via script. You need to disable modbus mapper before running this script. Post what you get in Logs tab. Change baud rate (19200) if needed.
Code:require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485-1', 19200, 'E', 8, 1, 'H')
mb:connect()
buffer = {}
mb:setdebug(function(msg)
buffer[ #buffer + 1 ] = msg
end)
mb:setslave(1)
res = { mb:readinputregisters(0, 16) }
log(res)
mb:close()
log(table.concat(buffer))
Code:
initscript 16.03.2020 19:22:02
* table:
[1]
* number: 22810
[2]
* number: 22845
[3]
* number: 22748
[4]
* number: 22828
[5]
* number: 22854
[6]
* number: 22819
[7]
* number: 22872
[8]
* number: 0
[9]
* number: 0
[10]
* number: 0
[11]
* number: 0
[12]
* number: 0
[13]
* number: 0
[14]
* number: 0
[15]
* number: 0
[16]
* number: 0
Code:
initscript 16.03.2020 19:22:02
* string: [01][04][00][00][00][10][F1][C6]
Waiting for a confirmation...
<01><04><20><59><1A><59><3D><58><DC><59><2C><59><46><59><23><59><58><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><85><1D>
Code:
{
"manufacturer": "Indomogal",
"description": "Universal 16+4 I/O module",
"mapping": [
{
"name": "Output 1",
"bus_datatype": "1",
"type": "coil",
"address": 0,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 2",
"bus_datatype": "bool",
"type": "coil",
"address": 1,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 3",
"bus_datatype": "bool",
"type": "coil",
"address": 2,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 4",
"bus_datatype": "bool",
"type": "coil",
"address": 3,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 5",
"bus_datatype": "bool",
"type": "coil",
"address": 4,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 6",
"bus_datatype": "bool",
"type": "coil",
"address": 5,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 7",
"bus_datatype": "bool",
"type": "coil",
"address": 6,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 8",
"bus_datatype": "bool",
"type": "coil",
"address": 7,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 9",
"bus_datatype": "bool",
"type": "coil",
"address": 8,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 10",
"bus_datatype": "bool",
"type": "coil",
"address": 9,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 11",
"bus_datatype": "bool",
"type": "coil",
"address": 10,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 12",
"bus_datatype": "bool",
"type": "coil",
"address": 11,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 13",
"bus_datatype": "bool",
"type": "coil",
"address": 12,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 14",
"bus_datatype": "bool",
"type": "coil",
"address": 13,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 15",
"bus_datatype": "bool",
"type": "coil",
"address": 14,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
},
{
"name": "Output 16",
"bus_datatype": "bool",
"type": "coil",
"address": 15,
"writable": 1,
"value_custom": {"0": "Off", "1": "On"}
}
]
}