LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU over TCP (Simex Transmitter and Advantech Server)

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!

 

0 Kudos
Message 1 of 9
(4,726 Views)

i also tried the TCP connection vi and the MB ethernet but this gives me an error 56

0 Kudos
Message 2 of 9
(4,725 Views)

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:

Modbus_Master_Example.png

Please test your device communication using this library.

 

Kind regards:

 

Andrew Valko

NI Hungary

 

Andrew Valko
National Instruments Hungary
0 Kudos
Message 3 of 9
(4,670 Views)

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

0 Kudos
Message 4 of 9
(4,640 Views)

Hello! can you shared your result vis.

0 Kudos
Message 5 of 9
(4,573 Views)

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

0 Kudos
Message 6 of 9
(4,531 Views)

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 🙂

0 Kudos
Message 7 of 9
(4,525 Views)

Hi Christo89

 

Would you mind please share your modifieded for Modbus RTU over TCP !
 
Thanks and Regards
 
Luong.Tran
0 Kudos
Message 8 of 9
(4,327 Views)
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

0 Kudos
Message 9 of 9
(4,321 Views)