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