Modbus driver

Hi,
First post on the forum, used to have RealBasic and just coming back to programming.
I am looking to use Xojo on a PC and raspberry Pi and create an interface to a WAGO PLC.
There is a Modbus driver Pymodbus https://pypi.org/project/pymodbus/ and I wondered if it is possible to incorporate this somehow to read/write data to the PLC.
Alternatively does anyone know of an alternative reliable system.

Regards,
Bob

some googlefu lead to this :

https://www.modbusdriver.com/modpoll.html
https://labjack.com/forums/other-software-languagestools/sample-code-xojo
http://www.modbus.pl/Visual%20Basic_MODBUS.PL.html

hope this helps.

Hi,
Thanks for replying, the VB6 looks interesting, I have downloaded it and am now looking at the VB Migration assistant.

Regards,
Bob

I have a reliable Modbus TCP slave module thats used in various building automation projects. Running bought Raspberry and windows and allows multiple simultaneous connections.
It’s built around memoryblocks for full Modbus addressing and to emulate old Modbus memory maps and manipulation from any Modbus master.

You would need Modbus TCP master to do what you want.
And you should also know that to use ports below 1024 (Modbus is 502) in Linux you need to run the application as superuser.

Hi,
Thanks for the replies, the VB6 link was great for the forms but used Winsock and another one I found used MScomm which I figure Linux will not have. I found another project which I think had some of your (kato G) code in. I have merged the 2 and now can read from the Wago PLC using windows. It was a bit confusing as WAGO / Codesys uses IEC 61131 numbering so address 0 is 12288 in Modbus.

Thanks for the info regarding the ports in Linux, that would have caught me out.

I am not sure of the best way to go forward, in a normal HMI/display you would just crate objects and use whatever address it had in the PLC, for what I am doing I think I will create a block of 200 integers (100 read & 100 write) so I can update periodically and not have to worry about getting data from all over the place. I have access to modify the PLC code so that seems the neatest solution.
This might be an issue for buttons as there may be a delay in writing the data.

Regards,
Bob