LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ModBus using serial server

I have the following setup:

 

[ PC ] ---------ethernet------------[ Serial Server ]----------rs485----------[ temperature controller]

 

The temperature controller talks ModBus ASCII or RTU over half-duplex RS-485.  I downloaded the ModBus package from ni.com but am very frustrated.  I can't seem to find a way to make it work with datasockets on the Ethernet side.  On other serial devices I talk to, I supply the IP address for the serial server device and a port number that corresponds to which serial port I want to access.  I can't incorporate this functionality into the ModBus code, however, since it seems to be locked down.  I also can't debug it since Highlight Execution is disabled.  Can anybody offer a better solution to this problem?

 

BTW, is it just me, or does this code look sub-par as NIs primary offering for ModBus support?

0 Kudos
Message 1 of 5
(3,187 Views)

The code may seem to be "sub-par", but in reality, ModBUS protocol isn't that complicated, it doesn't need a lot of fancy code.

 

Are you using Modbus TCP/IP or Modbus serial?  I've used serial a lot, but TCP/IP not at all.

 

What kind of drivers did the serial server come with?  I've used these remote serial servers before and their drivers create a new virtual com port on the PC.  The ModBUS code will work just fine using the serial implementation by using a VISA resource for whichever Com port gets created on the PC by the serial server's drivers.

0 Kudos
Message 2 of 5
(3,177 Views)

RF--

 

Thanks for the reply.

 

Regarding sub-par, I'm not really interested in the amount of code but rather the quality.  Its hard to follow and hard to modify.

 

I am using serial ModBus-ASCII but connecting over TCP/IP with the serial server.  My serial server will work the way you have stated by virtual COM ports but this is undesirable since their redirector software has to be run every time to use that feature.  I can't tell my customer, "Just run this redirector software every time you want to run my LV code." especially when using a socket connection is readily available.

 

There ought to be a way to programmatically generate a VISA resource in LV.  Anybody know of a way to do this?

 

Thanks,

kc64

0 Kudos
Message 3 of 5
(3,166 Views)
Can you post a manual for the serial server?? Normally you have to map ip addresses to specific devices on the serial port. Do you configure the serial server with a browser??
0 Kudos
Message 4 of 5
(3,154 Views)

Yes, the device is configured using a web browser.  I am using the Lantronix EDS4100 device.  The 4MB user's manual is here.

 

When I contacted the mfg regarding the best way to use the product with LV, they suggested that directly connecting to the port with IP addr/port is the best and eliminates the need for the port redirector software which is an application that runs at the user level.

 

I am primarily interested in understanding if a VISA resouce can be produced from an IP address and port number.  That is how I access all of my other serial devices and would like to stick with it.

Message Edited by kc64 on 10-20-2008 09:36 AM
0 Kudos
Message 5 of 5
(3,126 Views)