Page 1 of 1

Modbus master plugin: hangs in TCP mode

PostPosted: Sun Jan 19, 2025 11:35 am
by richardk
I have a problems with ModbusMaster plugin in TCP mode. I use UCCNC version 1.2117 (didn't try in another version).
I use following Waveshare RS485 to ETH gateway device on the spindle VFD site:
https://www.waveshare.com/wiki/2-CH_RS485_TO_ETH_(B)#MODBUS_TCP_Test
I managed to get the devices to communicate however after some time (minutes to hours) the functions get stopped to be called/updated:
scr1.png

I see on the Waveshare device that the TCP connection is still active, ModbusMaster just stops to send the requests. Restart of the Waveshare device doesn't help (Modbus Master doesn't reconnect), I need to stop and start "loops" in the plugin screen to get it working again. I tried to play with various parameters, timeouts etc on the device site without success, when I try to change the "loop interval" in the plugin it seems that for longer internal (100ms) the problem happens later (however not sure about this). I think that the problem is on the plugin site.

Plus there are various "UI state indication" bugs in plugin's debug view, e.g.:
- above case (everything is green but no data transfer performed)
- when the device is misconfigured (not replies) but accepts the connection i see this in debug view:
scr2.png

so all green and again no hint about the problem

Plus I am facing strange annoying bug when I want to change the IP address, I do it in connection settings, pressing Save settings, everything looks be ok but it tries to connect on another IP (previous?), Checking the connection settings, everything looks be correct. Then I check the profile file: there is a wrong IP there! I need to rewrite it manually in the file and restart UCCNC to get it working on the IP I want. What is strange that obviously sometiomes (maybe first time? not sure here) it works..

Profile.zip
(24.33 KiB) Downloaded 125 times

Re: Modbus master plugin: hangs in TCP mode

PostPosted: Thu Jan 23, 2025 7:25 am
by Ruslan
I also have some strange issue. My VFD is controlled through modbus RS485. All functions such as start and stop are working good. But not all data from modbus plugin is visible in UCCNC. For example I can see current RPM on main screen. But custom text fields are not filled with the data I got from VFD. I wrote custom macro for controlling VFD and to take data(temp, load) from it. This macro is running in macroloop and I can see that registers of modbus plugin has data but this data is not transferred to my text fields. it was working good in 1.2115 but not working in 1.2117.

Re: Modbus master plugin: hangs in TCP mode

PostPosted: Thu Jan 23, 2025 8:18 am
by richardk
I've ended up writing my own plugin which implements Modbus TCP communication. It works without any problems with the device..

Re: Modbus master plugin: hangs in TCP mode

PostPosted: Thu Jan 23, 2025 11:26 am
by Ruslan
Did you output vfd data to uccnc screen? Can you show your macro?

Re: Modbus master plugin: hangs in TCP mode

PostPosted: Thu Jan 23, 2025 12:13 pm
by richardk
I am controlling the screen from my plugin now so I don't need a macro in macro loop. However previously (when I tried to use the ModbusMaster) I've had this macro:
M20304.txt
(6.61 KiB) Downloaded 146 times

It worked however, as I wrote, ModbusMaster plugin always stopped to update after some random time. Your problem is not related to my topic..

Re: Modbus master plugin: hangs in TCP mode

PostPosted: Mon Mar 24, 2025 9:28 pm
by richardk
Seems like nobody cares after 5 months from my report. In each case It is useful experience for me..

Re: Modbus master plugin: hangs in TCP mode

PostPosted: Tue Mar 25, 2025 1:37 am
by cncdrive
I will have to check the plugin, because my collegue Dezsoe made developments on it and unfortunately he died in December, so I can't ask him anymore. :(