08-17-2010 01:04 PM
Hi, all
I am currently trying to connect to a remote NI OPC server with our own OPC client, but we are having problem right now. Here is the description:
The server machine is running National Instruments [National Instruments.Variable Engine.1 OPC server] on Windows Vista Business. We are able to connect to the OPC server locally on that machine using Matrikon OPC explorer. This machine has IP 10.1.0.1. The client machine is connected to the server machine using a crossed network cable. Both machines have the Windows firewall off.
Our client machine runs Windows XP, with its IP set to 10.1.0.2. The default gateway is set to 10.1.0.2, so all traffic is routed through the crossed network cable. It has National Instruments [Measurement & Automation Explorer (MAX), version 4.6.2f1] and Matrikon OPC explorer [version 3.3.2.0] installed.
We can successfully connect to the NI OPC server using Matrikon OPC explorer, by specifying 10.1.0.1 as the server host, and [National Instruments.Variable Engine.1] as the server name. In Matrikon OPC explorer, we see two NI OPC servers- one on the client machine, and one of the remote server machine. Both have the same server name.
When we try to connect to the remote server OPC using custom VB code utilizing OPC Data Access Automation 2.2.5.0 (wrapped in OPCDAAuto.dll), we get an "unspecified error".
The code we use is:
OPC = New OPCAutomation.OPCServer
OPC.Connect(OPC_Server, OPC_ServerHost)
Where OPC_Server="[National Instruments.Variable Engine.1]" and OPC_ServerHost="10.1.0.1".
We are able to connect to the local NI OPC server by setting OPC_ServerHost="localhost" and the same server name.
We noticed that the client machine has a program (supposedly the NI software) which listens to local port 135 (OPC port), which then routes to a port on the server machine (10.1.0.1). We are not sure if this means that the local NI server on the client machine is a shadow copy of the remote server?
Thanks!
08-19-2010 11:01 AM
You should not need multiple instances of the NI OPC server and you may not need NIs OPC server at all. It sounds like you have set up multiple copies. Your system should have 1 OPC server and one or many OPC clients. Make sure you only have the NI OPC server installed on 1 machine, their should be no shadow copies. I think this issue is liekly related to DCOM.Check out the following linkk for how to set DCOm for remote OPC.
http://digital.ni.com/public.nsf/allkb/862567530005F09C862567660047D840?OpenDocument