09-05-2024, 07:46 AM
Hi, I have read the ModbusRTUslave libary manual, and I have modify existing code, with my basic knowledge -
Adapter is working as a MODBUS RTU Slave with such parameters
addresss - 2
baund 9600
8
None
1
It is working correctly with PLC as Master with coil READ, Adapter is working as Slave
I will attache the file for other users
I have also made an WRITE option for coils, but that need to be tested - it is usefull if the state of coil change in the PLC then the change is visible on the adapter app (for example You swith on the light and the status in Tuya app will be changed) , as the coil status is overwritten in the adapter in the loop - that cause some issues with stable switching on or off - as there are some transmision going so you could switch on and the incoming transmision will switch off - so if enybody has an idea how to solve it that will be nice
Adapter is working as a MODBUS RTU Slave with such parameters
addresss - 2
baund 9600
8
None
1
It is working correctly with PLC as Master with coil READ, Adapter is working as Slave
I will attache the file for other users
I have also made an WRITE option for coils, but that need to be tested - it is usefull if the state of coil change in the PLC then the change is visible on the adapter app (for example You swith on the light and the status in Tuya app will be changed) , as the coil status is overwritten in the adapter in the loop - that cause some issues with stable switching on or off - as there are some transmision going so you could switch on and the incoming transmision will switch off - so if enybody has an idea how to solve it that will be nice

