Using Vision Builder AI as an OPC Server

Updated Nov 1, 2023

Environment

Software

  • OPC Servers
  • Vision Builder for Automated Inspection

This document explains how to configure Vision Builder AI as an OPC server and use shared variables to share results produced by Vision Builder AI steps. OPC is a series of standard specifications that define the communication of real-time plant data between control devices from different manufacturers. OPC Data Access communication is a client server based communication.

Shared system variables allow you to share data with Vision Builder AI. You can use shared system variables to publish data using OPC.

Creating a Shared Variable

Complete the following steps to create a shared system variable.

  1. Select Tools»Variable Manager.
  2. Select the System Variables tab.
  3. Click Add.
  4. Enter a name for your variable and select a Type and Initial Value.
  5. Enable the Publish on Network checkbox.
  6. Click OK.
  7. Click OK to exit the Variable Manager.

 

Setting the Value of a Shared Variable

Use a Set Variable step to set the value of a shared variable. The Set Variable step is located on the  Use Additional Tools palette.

Complete the following steps to set the value of a shared variable.

  1. Add a  Set Variable step to the inspection. The property page for the step opens.
  2. Select a variable in the Variable list.
  3. Use the Operation controls to change the value of the shared variable or to set the value of the shared variable to a measurement.

Creating Tags to Be Shared by the OPC Server

This section applies only if Vision Builder AI is running on a remote target. If Vision Builder AI is running on Windows, continue to the next section.

If Vision Builder AI is running on a remote target, you must use a Windows computer to create tags and link them to shared system variables. For example, you might use the same computer that you used to configure the remote target. The Windows computer must meet the following requirements:

  • Either Vision Builder AI or NI LabVIEW is installed.
  • Distributed System Manager 2010 or later is installed. Distributed System Manager 2010 is available here.
  • The computer must remain available on the network in order to use an OPC client to access the data published by Vision Builder AI running on the remote target.

 

Complete the following steps to create the tags to be shared by the OPC Server.

  1. Launch the NI Distributed System Manager. From the Start Menu, select All Programs»National Instruments»Distributed System Manager 2010.
  2. Expand My Systems.
  3. Right-click localhost and select Add Process.

 
  1. Enter a Process Name, for example VBAI OPC Server.
  2. Click OK. The VBAI OPC Server process is listed under localhost.
  3. Right-click VBAI OPC Server and select Add Variable.

 
  1. Enable the Enable Aliasing checkbox.
  2. Click Browse and expand the IP address of the remote target where the inspection is running.
  3. Expand the Vision Builder item and select the variable that you want to share.
  4. Ensure that the Make properties match selection? checkbox is enabled and click OK.
  5. Click OK to create the OPC tag and link the tag to the Vision Builder AI variable.
  6. In the Name field, enter the name of the OPC tag you want to create. To prevent confusion, use the name of the selected variable.
  7. When you are finished creating tags, close Distributed System Manager.

Tags that you create are listed in your OPC client when when you connect to Vision Builder AI as an OPC server.

Distributed System Manager is only required to add or delete tags. You do not need to launch Distributed System Manager to enable OPC communication. Do not use Distributed System Manager to delete any variables listed under the Vision Builder process.

Connecting to Vision Builder AI as an OPC Server

Configure your OPC client to connect to the following OPC server: National Instruments.Variable Engine.

Use your OPC client to locate the shared variable tags:

  • Vision Builder AI running on Windows—The shared variable tags are listed in the Vision Builder folder.
  • Vision Builder AI running on a Remote Target—The shared variable tags are listed in a folder with the same name as the process you created in Distributed System Manager 2010, for example, VBAI OPC Server