Can't get modbus working on new LinuxCNC box

More
22 Apr 2022 07:11 #240857 by dannym
Finally made a breakout cable to find... the Modbus is returning perfectly valid packets. The code composes packets out and gets a response but the code's just timing out.

Please Log in or Create an account to join the conversation.

More
22 Apr 2022 23:06 #240937 by andypugh
Have you tried allowing a longer timeout period in the comp?

Please Log in or Create an account to join the conversation.

More
25 Apr 2022 01:47 #241135 by dannym
I don't see how to add that. My x200_vfd.comp user code doesn't pass a timeout to libmodbus, that's internal protocol stuff. Libmodbus says 0.5s, and if that's actually the time used then there's no way a response would be later than that.

I don't know how to modify and recompile libmodbus. I'd like to in order to figure out why the responses aren't counting. I can't think of a likely prob that would be specific to this setup.

Please Log in or Create an account to join the conversation.

More
27 Apr 2022 21:52 #241410 by andypugh

I don't see how to add that. My x200_vfd.comp user code doesn't pass a timeout to libmodbus, that's internal protocol stuff. 

Sorry, I am afraid I am out of ideas. And as you are the only one with your hardware and driver I regret to say you are probably on your own here. 

We know that the VFD works with a different OS. (confirm?) 
We know that other VFDs work with Libmodbus and LinuxCNC. 

We do not know if your VFD works with LibModbus  and LinuxCNC for anyone else. We don't know if your comp works (or did it work on some other config?)

The most likely place for the problem to be is in your .comp. 

Please Log in or Create an account to join the conversation.

More
30 Apr 2022 18:55 #241729 by dannym
Well I have mixed logic there.

We know we can send requests to libmodbus, it sends them out. Then libmodbus calls an error-printing task, but only passing a text string. All the error handling code is encapsulated in libmodbus.

So, the x200_vfd compile seems to "work". AFAIK if the Modbus packet was composed incorrectly, the VFD would not respond. As a slave, it only responds to complete commands for its specific address. I do see a response coming back. So the libmodbus code was called correctly from x200_vfd. Then it fails to get the response inside libmodbus, but nothing about the x200_vfd code should interfere with it. It makes no calls.

I'm thinking that perhaps libmodbus doesn't like this specific PC hardware. I did try the USB-RS232 cable but I now think that one probably doesn't produce valid RS232 levels anyways. But, Putty shows that Debian and the physical hardware can talk.

One thought that came to mind is libmodbus might be measuring time incorrectly. If it was somehow something invalid, it might register as timed out instantly. If so this wouldn't affect Putty, it'd be a general hardware-specific code glitch.

Sorry to labor this point. I need to get this installed and this is the roadblock I can't get around

Please Log in or Create an account to join the conversation.

More
02 May 2022 22:37 #241888 by andypugh
I can confirm that this works with LinuxCNC and the not-quite-modbus used by the HY VFDs (after cutting off the croc clips)

www.amazon.co.uk/DSD-TECH-SH-U13-Alligat...-black/dp/B082KKG55T

Though whether it is possible to source one at the moment is debatable.

Please Log in or Create an account to join the conversation.

Time to create page: 0.079 seconds
Powered by Kunena Forum