10-22-2013 07:16 AM
Hey Guys,
somehow i am not able to get a connection over TCP IP using RTU Mode (reading values) from a transmitter which is hooked up to an advantech EKI 1542 Server. The Port is configured as an RS 485.
i am using the modbus library and i tried to adjust the MB serial read holding registers vi to accept a TCP IP Socket input instead of an INSTR. Do you have any suggestions?
Thanks a lot for the forum support!
10-22-2013 07:18 AM
i also tried the TCP connection vi and the MB ethernet but this gives me an error 56
10-24-2013 05:43 AM - edited 10-24-2013 05:43 AM
Hi Christo and welcome to NI Forums!
Is this the ModBus library you are using? If so, I'd recomend to check out the newer, object based library available here. It has a more straightforward setup, especially for using TCP connections. You'll find an example VI for using a master, as well as a slave device, and these you'll be able to use right away without much modification. The code'll look like:
Please test your device communication using this library.
Kind regards:
Andrew Valko
NI Hungary
10-30-2013 03:07 AM
hey thanks for your help. i finally got it to work modifying the old modbus library so that the serial vis take in a tcp/ip socket 🙂
cheers
11-21-2013 09:37 AM
Hello! can you shared your result vis.
11-28-2013 05:03 AM
Hi Christo89
i have at the moment the same problem as you. Before starting to modify the old lib I have found your solution. It would be very nice from you to share your lib!
christoph
11-28-2013 07:20 AM
hey guys
sorry for the delayed answer.
sorry i dont have the vis at hand right now. but i can try to explain the fix
it was a pretty easy fix afterall. i opened a connection to the server with the visa open vi putting in a tcp/ip socket.
then i fixed the the MB Serial Master Query Read Holding Registers and its sub vis to take the tcp/ip socket as an input.
in the MB serial receive vi you have to delete the bytes at port property node and replace it with read visa with a byte count of 1024.
delete the upper error wiring due to errors related to the socket thing and thats it. works like a charm 🙂
12-21-2014 11:36 PM
Hi Christo89
Would you mind please share your modifieded for Modbus RTU over TCP ! Thanks and Regards Luong.Tran
12-21-2014 11:41 PM
Date Last Visited | 11-28-2013 10:20 AM |
What do you think the odds are that he'll reply? You'll have more luck trying to implement the code he suggested