Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
2 ratings:
 3 out of 5     Rate this Document

How Do I Connect to an OPC Server Using DataSocket?

Primary Software: Other NI Software>>DataSocket
Primary Software Version: 4.2
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I know that I can use DataSocket to communicate with an OPC server, but how do I connect and disconnect with the server?

Solution:
DataSocket handles this functionality for you. Simply enter a valid OPC URL into DataSocket Read or DataSocket Write VIs (see attached example: dsopc.vi). As the first step in accessing an OPC server, DataSocket will establish a connection by launching the relevant OPC server. If you are running Windows 2000/XP, you will see the relevant OPC server running as a process. When the VI is stopped, the process is shut down.

Related Links:


Developer Zone Tutorial: Connecting LabVIEW to an OPC Server through a DataSocket Connection
KnowledgeBase DIRECT-45GPP3: Using DataSocket with OPC
KnowledgeBase 1JHG366Y: How Is the URL Built in DataSocket, and How Is It Used in LabVIEW?



Attachments:


dsopc.vi - dsopc.vi



Report Date: 10/01/2003
Last Updated: 08/25/2007
Document ID: 320BS5OP

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit