LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to use Labview DSC to Modbus over Lantronix using ethernet encapsulation?

Hi,

 

I'm currently evaluating LabView DSC 2009. I want to connect to a Modbus PLC system, which is rs232, connected via a Lantronix box. I have the Lantronix software installed for com port redirection. I set up a serial Modbus I/O server, and every works great.

 

I was also playing around with the demo of LabView OPC Servers, and noticed that instead of selection com2, I was able to select ethernet encapsulation, and directly type in the IP address & port of the Lantronix box, and it worked great as well.

 

However, I noticed that when I close things out using the serial connection, it still leaves the port open & the computer connected to the serial port (verified using the Lantronix Manager). If I use the ethernet encapsulation route, it closes everything completely (since it doesn't use the installed Lantronix software redirector).

 

I have another user who will occasionally need to connect to the PLC using ProWorx, over the same Lantronix box, using a different computer. This often requires me to manually close out & disconnect the port, unless using the encapsulation method.

 

My question is: Using the DSC Module (over Modbus I/O server), can I use ethernet encapsulation instead of having to manually/force close the com port?

 

Thanks,

Jacob

0 Kudos
Message 1 of 5
(2,980 Views)

Hi Jacob,

 

Thanks for the details on your setup.  When setting up your Modbus I/O Server in your project, have you tried selecting Modbus Ethernet and are you able to communicate with the Lantronix device this way?

 

In your project, click My Computer>>New>>I/O Server>>Modbus, and you should get an option dialog box where you can select Modbus Ethernet as the communication method.  Does selecting Ethernet communication this way give the same behavior as the OPC Server Ethernet Encapsulation setting?

Regards,
Austin S.

National Instruments
Academic Field Engineer
0 Kudos
Message 2 of 5
(2,948 Views)

Thanks for the reply, Austin.

 

I did try that method, and it did not work. That option is for direct Modbus Ethernet modules.

 

The original reason I wanted to use DSC(which I probably should have clarified in my first post) was that I have several hundred registers to read, and did not want to set up a DataSocket connection for each tag. Too slow, and too much upkeep. We didn't need any of the trending, alarming, etc in DSC.

 

However, I realized that the NI OPC Server allows me to grab an array of registers as one tag. I can then set up a DataSocket connection to read that array, so I can read a hundred (or so, need to do some stress testing) of registers with just one DataSocket. Many of the other OPC servers I tested did not allow the array, KepWare & NIOPC do.  So I had my purchasing person place an order for NI OPC.

 

Thanks again for the reply,

Jacob

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

Jacob,

 

Thanks for clearing that up.  You should definitely be able to read an array of data from NI OPC Servers using Datasockets as you've described.  However, if you're trying to write & publish values using Datasockets, you will run into some problems as Datasockets does not have the ability to write array data types at this time. 

 

This looks like the way to go for what you're trying to do.  For your reference, a couple of caveats that have been noted are documented in this KnowledgeBase article, but shouldn't have too much effect on what you're doing here.

 

Let us know if you have any problems getting up and running with your NI OPC Servers or reading your data from the PLC and we'll be happy to help.

 

 

Regards,
Austin S.

National Instruments
Academic Field Engineer
0 Kudos
Message 4 of 5
(2,916 Views)

Hi,

 

As you noticed, there are differences between Modbus RTU, Modbus RTU/IP (encapsulated) and Modbus TCP. The first involves the use of a Com port on your computer and on the PLC. The second involves the use of a Device Sever (TCP Server) without using a Com port on your computer and not on the PLC. The third involves Ethernet media only.

 

Using Modbus RTU encapsulated, your computer keeps com ports free. So, you don't have to open and close the com ports. This task is performed by the Device Server (between PLC and PC).

 

I have been using Share variables to read/write from/to an array of singles with success, and definetly it's better than doing it at single read/write.

 

KepServer Array

 

You will find tha NI OPC Servers and KepServer are the same software.

 

Shared Variable Array

 

Now you can read/write from/to an array

 

DataSocket Array

All this process is performed without using PC's Com Ports

0 Kudos
Message 5 of 5
(2,895 Views)