LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting LavView on PC1 to Omron CX Server on PC2 via LAN

Hi,

 

I am a total novice when it comes to OPC and have a few simple questions I would like to pose. I have a PC running LabView and second PC running an Omron CX Server which is connected to a PLC system. The two PC's are on the same subnet.

 

1. Is there a way for me to access the Omron CX server via LabView over LAN and access the data there (ie, via the Shared Variable Engine) or

2. do I need to install another CX server on the LabView PC and connect directly to the PLC (which is also on the same subnet).

3. If 1., which connection type (DataSocket?) do I use and where can I find information on how to configure this.

 

Regards,

 

Casper

0 Kudos
Message 1 of 7
(4,140 Views)

Hi Casper,

 

You should be able to access the data tags on the PLC from Labivew by using DataSocket. http://zone.ni.com/devzone/cda/tut/p/id/3980

Please let me know if you can't connect to your PLC.

 

Thanks

 

-----------------------------------------------------
Dennis Morini
District Sales Manager
National Instruments Denmark
http://www.ni.com/ask
Message 2 of 7
(4,081 Views)

Hi Dennis,

 

Thanks for your reply. I do actually have problems connecting with the OPC server over LAN. I can connect and read/write values if I execute my VI on the same machine as the server is on. I can also connect and read/write values over LAN from any machine with the NI ServerExplorer and other OPC clients - so I assume I have correctly configured COM/DCOM. However, the OpenDatasocket VI returns the generic Error 42 when I try to open a connection via LAN. Others seem to have this problem, although I havn't found any solution ( http://forums.ni.com/ni/board/message?board.id=170&thread.id=351045 ).

 

Maybe you have a suggestion?

 

Thanks.

0 Kudos
Message 3 of 7
(4,071 Views)

Hi Casper,

 

Thanks for the update. I presume that you have tried Everything from the thread you linked, and still having the problem.

Please make sure that you have followed: http://digital.ni.com/public.nsf/allkb/5C8A90CD57B279F286256C2C006F1EB4?OpenDocument

 

Does your PC ethernet card have an automatically assigned IP? If yes, can you try to assign a static IP in the same subnet?

 

The other way to connect to OPC items in LabVIEW is to use the Datalogging and Supervisory Control (DSC) Module. 

The DSC module allows you to bind OPC items directly to shared variables.  The DSC module is recommended for higher channel count applications.

 

I hope this helps.

 

Thanks!

Dennis

 

-----------------------------------------------------
Dennis Morini
District Sales Manager
National Instruments Denmark
http://www.ni.com/ask
Message 4 of 7
(4,059 Views)

Yes, I've tried everything in the thread. As mentioned, LAN connection works fine with the NI ServerExplorer.. just not my own VI's. I have also tried putting the PLC, OPC Server and client PC on the same isolated subdomain. I'm aware of the DSC module, but for my use this would be overkill. The DataSocket Open and Read/Write VI's should be just fine. If they worked.

 

If there's a fairly easy way to make this work it would be of great help. Alternatively, since local VI's do seem to work, I am creating a client to run on the OPC Server machine to hook up with the server, and then read/write over LAN via UDP.

Message Edited by budtz on 09-17-2008 12:37 PM
0 Kudos
Message 5 of 7
(4,048 Views)

Hi Casper,

 

Your are right about the workaround for your problem.

If you can't get the Datasocket solution to work, you can always create a LV application which can read/write tags on the PLC, then connect them to shared variables. Run the application on the client PC with OPC server. 

On your host PC, use shared variables to access those tags/variables on the client PC. Remember to install the Shared Variable engine support on the client PC.

 

I hope it all makes sense. Please let me know if you can use this solution.

 

Thanks!

-----------------------------------------------------
Dennis Morini
District Sales Manager
National Instruments Denmark
http://www.ni.com/ask
Message 6 of 7
(4,040 Views)

Hi Dennis,

 

Well, I ran into the same problems with the SVE as I did with the OPC server. I can connect to it fine over LAN with any client expect native LV VI's. Firewall, routers and DCOM setting are all open. Instead of spending time on troubleshooting this I decided to send the data using the low-level UDP command, which works just fine.

 

Thanks for your help!

 

Casper

0 Kudos
Message 7 of 7
(4,017 Views)