Thanks for that suggestion.
I wanted a cleaner approach that did not require a device driver. This would also let me use very inexpensive TCP-to-Serial devices that do not have Linux driver support such as the Wiz1000 (see
wiznet.co.kr/wiz1000) which is what I'm using in my test lab (and will shortly deploy into the field).
Since the fundamental difference between MODBUS RTU over serial comms and MODBUS RTU over TCP is simply the communications medium, I thought it would be relatively straightforward to add this feature to libmodbus, but when I started on the project little did I realise that the exceptionally clean design and beautifully designed libmodbus would make the work trivial.
All I had to do was copy and paste existing code to create a new function:
modbus_t* modbus_new_rtutcp(const char *ip, int port)
and everything worked as expected first time. I only had to write three lines that were not pure copy and paste.
Kudos to Stephane Raimbault!
I have not had a chance to test the code very much and so will wait until I have had a chance to do so before posting it (and passing it on to Stephane). If anyone is in a hurry to get it, please write to me directly.
On Monday, June 25, 2012 11:46:51 PM UTC-7, Torello Querci wrote:
Hi George.
I have this configuration on production. ù
Unfortunally libmodbus is not able to manage directly tcpip/serial
converter and I think that this is right.
In order to comunicate with the ethernet/serial converter I use the
tibbo driver downloaded from here
http://tibbo.com/downloads/soi/vspdl.html
Using this driver I able to see the remote serial port as local serial
port (device /dev/vsps0, /dev/vsps1 ....) and now I can use the
libmodbus to
get and set register values.
I not know if this driver is compatibile with your device.
Best Regards,
Torello Querci