Modbus RTU Master "Modbus_Master_Status"
Posted: 13 Dec 2019, 14:39
Hi everyone,
I seem to be having quite a strange problem. From reading the documentation about the Modbus RTU Master, it seems to me that the "Modbus_Master_Status" variable should change based on if an error occurs (eg, if a slave device is disconnected). What I'm trying to do is use the Modbus RTU Master to connect to an arduino which transmits some sensor data. The communication works perfectly and I'm able to read the data correctly. However, I've discovered that when I disconnect the arduino while the modbus is running, the "Modbus_Master_Status" variable does not change (it stays on "0"). But if i run "piTest -x" the modbus master status changes to 255. Even writing "1" to the "Master_Action_Reset" seems to have no effect. Only a full driver reset seems to make any change. From what I can tell from the documentation, if a device is disconnected the master status should change to 0x10 or 0x11, not 255. Even after confirming that the devices no longer show up on the RevPI Connect (by running "ls /dev/ttyACM*"), the master status stays at 0 after a disconnect. Any idea why this is happening? The same anomaly occurs with the "Modbus_Action_Status_1" variable.
thanks
I seem to be having quite a strange problem. From reading the documentation about the Modbus RTU Master, it seems to me that the "Modbus_Master_Status" variable should change based on if an error occurs (eg, if a slave device is disconnected). What I'm trying to do is use the Modbus RTU Master to connect to an arduino which transmits some sensor data. The communication works perfectly and I'm able to read the data correctly. However, I've discovered that when I disconnect the arduino while the modbus is running, the "Modbus_Master_Status" variable does not change (it stays on "0"). But if i run "piTest -x" the modbus master status changes to 255. Even writing "1" to the "Master_Action_Reset" seems to have no effect. Only a full driver reset seems to make any change. From what I can tell from the documentation, if a device is disconnected the master status should change to 0x10 or 0x11, not 255. Even after confirming that the devices no longer show up on the RevPI Connect (by running "ls /dev/ttyACM*"), the master status stays at 0 after a disconnect. Any idea why this is happening? The same anomaly occurs with the "Modbus_Action_Status_1" variable.
thanks