frangoteam / FUXA

Web-based Process Visualization (SCADA/HMI/Dashboard) software
https://frangoteam.org
MIT License
2.52k stars 751 forks source link

[BUG] [FEATURE] Command confirmation for switches ModbusRTU and RTUoverTCP #1178

Open maufc opened 2 months ago

maufc commented 2 months ago

Describe the bug Modbus RTU and RTUoverTCP switches should wait for the response (confirmation) in order to confirm the new state of the switch. The switch button should wait the response of the device. At this moment, if the command was not executed, the states changes until a new regular requests is make. I found also that the commands can me send at the same time the regular requests are made making crossing modbus queries to the device. The problem origin could come from this problem: https://github.com/frangoteam/FUXA/issues/1148 waiting for a response.

To Reproduce Just define a tag (coil status) of a modbus rtu connection and assign it as a property to a switch. Go to Lab, and try to change the coil status with the switch. See the app log and the port log.

Screenshots

Captura desde 2024-05-04 12-17-19

Captura desde 2024-05-04 12-18-35

Environment

rvbatista commented 2 months ago

ModbusRTU should be used for serial communication from the server, and RTUoverTCP should be used with serial device using transparent gateway. I have to check if there is some kind of mechanism to handle concurrent requests, but I think that neither Fuxa nor Modbus-serial have this. And it's kind of critical for serial devices.