Connecting LabVIEW To An OPC Server Through A DataSocket Connection
Connecting LabVIEW To An OPC Server Through A DataSocket Connection
40 ratings | 3.30 out of 5 Print You can use LabVIEW as an OPC client by connecting to an OPC server through a DataSocket connection. This document shows how to use an example VI that connects to the Lookout Protocol Drivers server to read a register value from a Modbus device. You can use this procedure to connect VIs to devices on any OPC server, such as FieldPoint, NI-DAQ, RSLinx, or Applicom. Make sure you have LabVIEW 6.0 or later and Lookout Protocol Drivers 4.5 or later installed on your computer before completing this procedure. Complete the following steps to read a PLC register value from a Modbus device on the Lookout Protocol Drivers OPC server to a VI using a DataSocket connection. 1. Open the opc.llb in labview\examples\comm. 2. Open the Multiple OPC Items Monitor VI. This VI uses DataSocket to connect to an OPC server. You can press the <Ctrl-E> keys to display the block diagram and examine how it works. 3. On the front panel, toggle the horizontal switch to Select Items and set Number of items to select to 1, so you can select a single register value.
4. Run the VI. The Select Item 1 dialog box appears and displays all the OPC servers available to your system. Navigate to National Instruments.OPCLookoutDriversLookout Protocol DriversModbus1 and select register 40001-49999. Click the OK button.
5. If your connection is successful, the waveform chart displays the B:0 register value.