LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need help with Modbus Ethernet communication

I try to communicate with a Modbus RTU controller with a MOXA Ethernet to RS232 converter. I use DSC module to create a modbus Ethernet driver, and create a list of shared

variables that are bound to individual addresses in the modbus register.

I have tried for a long time to make this communication stable, but I lose communication after a couple of hours..

I read hex values from the controller registers, and they normally is from 100 to 140 depends.. But after a while some of my

registers drop to zero, and others up to 65408 for instance..  and some digital values hang..

When I restart my vi, it works again for some hours..

 

Maybe it is a communication problem true Ethernet, because I have tested shared variables in other ways, and it works fine..

I want to know if there is any specific rules how to put up a good way to communicate with my modbus driver true Ethernet.. I have enclosed one of the examples that I tried, and I have also tried to read values directly into while loops, but I lose communication after a while

Anybody…  please I need help. I would be happy to see a good and stabile way to put up a communication example.. 

I also tried some of the modbus examples, but I didn't manage it to work.. I use one master controller and one slave, and I use ID 32 for

the master and ID 01 for the slave..

Thanks..

Very best regards from..

Benji..

 

0 Kudos
Message 1 of 3
(2,829 Views)

Have you tried the NI Modbus Library?? For a small application, you don't have to use the DSC stuff. You could also try using an OPC server with the DSC module. This way all of the communication stuff happens inside the OPC program and you don't have to worry about it.

http://sine.ni.com/devzone/cda/epd/p/id/4756

0 Kudos
Message 2 of 3
(2,818 Views)
Hi.. and thank's for your answer..
Yes, I have downloaded and tried the modbus lib before, and it works, but I have to rebuild it to make it work good for my system..
Maybe that is the way to go..  But I also thought that when I have DSC installed, it would be easier to use that one..
In the mean time I've did some test's and, I see that the problem maybe is in my modbus gateway..
Anyhow.. thank's for your answer...
 
Regards from Benji..
0 Kudos
Message 3 of 3
(2,783 Views)