From: Dag Rune on
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  :-))
From: unclebump on
see these threads for some info on issues with the slave functions.
<a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=174314&amp;requireLogin=False" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=174314&amp;requireLogin=False</a>
<a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=176217&amp;view=by_date_ascending&amp;page=1" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=176217&amp;view=by_date_ascending&amp;page=1</a>
&nbsp;
&nbsp;
&nbsp;
Try downloading portmon to look at the serial data.
&nbsp;
<a href="http://www.sysinternals.com/Utilities/Portmon.html" target="_blank">http://www.sysinternals.com/Utilities/Portmon.html</a>