Accessing Remote OPC Server Using DataSocket
Overview
Before starting with the configuration, there are a few important notes:
Note 1: In order to run remote OPC, both machines must be logged on to the same NT domain. In other words, remote OPC assumes an NT server on your network that defines an NT domain. We recommend using the same user account for both machines for troubleshooting.
Note 2: There is not a significant difference between running Windows 9x/Me and NT/2000 on the client computer. However, there is a significant difference on the server side. While OPC servers on NT/2000 machines can be launched remotely by the (first) client, Windows 9x/Me does not have this capability. The server must already be running before the remote client tries to connect. The real complication is the fact that the OPC servers cannot be launched manually in most cases. So, how do you start such a server if you cannot do it either manually or remotely? You have to start it from a local client. Once it is launched, you can connect from a remote machine. For this reason we recommend that you use NT or 2000 on the server side.
There are two ways in which you can access a remote OPC server:
1. Access the remote OPC server directly from the client machine
In this case the OPC client directly, specifically asks DCOM to launch the OPC server on a remote machine. The two parameter that the client passes to DCOM are the remote machine name and the OPC server ID.
2. Redirect a local OPC server (on the client machine) to the remote OPC server
In this case the client asks DCOM to launch the local OPC server. However, DCOM is commanded (in its configuration) to launch the server on a remote computer. This procedure is transparent for the client.
Notes for NI OPC Servers
1) Lookout Protocol Drivers - after you configure the Lookout Protocol Drivers, make sure you exit. If you do not exit, the OPC server will not be able to launch.2) FieldPoint OPC Server - make sure you have a valid configuration loaded in FieldPoint Explorer. Unlike for the Lookout Protocol Drivers, you can leave the FieldPoint Explorer open when the OPC server is being launched.
3) DAQ OPC Server - make sure you configure the virtual channels in MAX. You can leave MAX open when the OPC server is being launched.
Setting Up the Remote OPC Communication
Refer to the following documents for instructions how to configure remote OPC:
Remote OPC Server on Windows NT/2000
Remote OPC Server on Windows 95/98/Me
Now complete the following steps:
On Client computer:
- In LabVIEW go to Help>>Examples>>Communication Examples>>DataSocket OPC.
- Click on the link Browse to OPC Item. This VI will help you build an OPC path to the server item. Run the VI.
- Choose an item from the respective OPC server. If you are directly accessing the remote server, browse through My Network Places. If you are redirecting local server to remote, select the local server. Click OK. You will see the URL in the box labeled URL.
Refer to the other OPC examples for more help. For more detailed descriptions about how to construct the OPC item URL, refer to DataSocket Help (Start>>Programs>>National Instruments>>DataSocket>>DataSocket Help. Choose the Index tab and search for OPC. Select OPC and choose OPC Definition.)
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
