LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU RS485 Labview 8 DSC

Hello, forum!
 
I'm in a project were I'm going to transfer data between my Labview application and an Anybus communicator from HMS-networks.com. The Anybus unit is just a translator between the sub network(my application) and a field bus used by the above control system. On my computer I have Labview 8 and a NI RS485 card. I'm using 2wire auto mode and have made test cables based on datasheets from NI and HMS. The transfer is based on Modbus RTU, and my application is the slave.
I have a Third party modbus simulator software, and with this simulator I can confirm successful comm. between my computer and the Anybus unit. As far as I can see, this means that the RS485 card is OK, MAX is OK, cable is OK and the setup of the Anybus unit is OK.
 
But...when I run my labview application, the line is dead. No comm. is possible to monitor.
 
I have tried two approaches:
 
1: In the NIMODBUS library there is an modbus slave example and an modbus master example. From reading the forum I have the impression that this library is widely used. My thinking was that by running the slave on one port of the NI card, and the master on the other port with a cable in between, I could prove that my application/slave was working. And actually it did. I was quite happy for a while, but this was prior to receiving the Anybus unit. When setting up the system the way it is supposed to be, then my worries began.
 
2: In Labview 8 with the DSC module installed one can make  an IOServer that is a modbus RTU slave. I made a slave according to tutorials and help files. This is more to my liking since the IoServer is more of a built in functionality. The library seems to me to require more knowlegde of labview and modbus. Still, my IOServer slave got me no further.
 
 
Neither were able to comm. with my simulator. My simulator is my reference point since it gives good monitoring possibilities. I have implemented all fixes and tried all hints that I have found in the forum. All parameters are checked again and again. I found a note saying that the NI card had an upper limit when it comes to baud rate, but my simulator and Anybus unit worked fine on a much higher baudrate than the note pointed out. Baud rate, address and all these settings isn't a mystery to me. I'm  wondering if Labview is talking modbus in the way expected. For instance, why is there no documentation(that I  have found) on which function codes supported? As an example, FC 08 "Loopback diagnostic test", is a code which isn't supported by all slaves. Where does it say that this and other codes are or aren't supported?  What was really going on when data were transfered (over the cable?) between the example slave and the example master?
 
I hope there is someone out there with an idea, a proven application towards external equipment, or any kind of information that can be of help.
I'm not an expert of neither labview nor modbus. I can't rule out that it is my labview installation that is bad, or that the DSC engine isn't implemented correctly, or that I'm plain and simple too stupid. I can't help thinking that modbus has to be so common even to labview that something similar has been implemented somewhere......
Time is running out on me...., you know how it is when the customer is getting impatient  :-))
0 Kudos
Message 1 of 4
(8,336 Views)

Pleased to make your acquaintance, Unclebump. I've noticed that you've come to the rescue of many a labviewer. Thanks a lot!  

The Portmon software did the trick. It made me aware of events that were the direct cause of my problems. Some of my settings were immediately overwritten by Labview. Now I'm "back in business".

Still, when it comes to the DSC/IOServer, I would suggest for NI to make a kind of checklist. A checklist to test and rule out different possibilities, and how and were to look for error messages and so on. I haven't managed to get mine to work. 

 

Dag Rune

0 Kudos
Message 3 of 4
(8,280 Views)

I'm trying to interface LabVIEW to an HMS Anybus-IC to convert between RS232 on a NI-sbRIO to Profibus.  Do you have any VI's from your original project that would be helpful in doing this and that you'd be willing to share?  - Neal Pederson, np@vicontrols.com.

0 Kudos
Message 4 of 4
(4,709 Views)