Customizing the Inspection Interface in NI Vision Builder for Automated Inspection – Part I

Updated Nov 17, 2020

Environment

Software

  • Vision Builder for Automated Inspection

The ability to customize the inspection interface is a new feature introduced in Vision Builder AI 3.5. This powerful feature provides a way to customize how the inspection interface looks, and can even control the flow of the inspection or change parameters used in steps of the inspection while the inspection is running.

NI Vision Builder for Automated Inspection 3.5 or later (Vision Builder AI) allows you to customize the Inspection interface. This tutorial is the first document in a three-part series that guides you though setting up a simple Inspection interface. Refer to Customizing an Inspection Interface in NI Vision Builder for Automated Inspection – Part II and Customizing an Inspection Interface in NI Vision Builder for Automated Inspection – Part III for advanced Vision Builder AI custom Inspection interface examples.
 

Feature Highlights

The following highlights are available in this new feature:

  • The ability to localize text, add company logos, or leverage the extensive library of LabVIEW user interface (UI) controls and indicators to show specific results in your Vision Builder AI Inspection interface.
  • The Inspection interface can have indicators of numeric, string, boolean, or image display data types that Vision Builder AI updates with results or images from steps in the inspection. Users can therefore display multiple images, use strip charts to show historical data, or have Vision Builder AI update indicators with results from the inspection.
  • The customized Inspection interface can be viewed while running on a real-time target through a web browser. The NI CVS-1450 Series compact vision system and NI 17xx smart cameras support a Web server that can publish the custom Inspection interface when the inspection is running. This feature is useful for viewing and controlling the inspection from a remote location that isn’t running Vision Builder AI.
  • Numeric, string, or boolean controls are used within the inspection in the form of previous results. Any step in the inspection that supports previous measurements or state transition decisions can use the value of these controls on the interface.  The controls on the Inspection interface give you control over step parameters and the flow of the inspection from controls on the custom interface while the inspection is running. Refer to Customizing an Inspection Interface in NI Vision Builder for Automated Inspection – Part II and Customizing an Inspection Interface in NI Vision Builder for Automated Inspection – Part III for more information on this feature.
  • When using a LabVIEW VI for the Inspection interface, users can run the code on the VI block diagram when the interface is updated. This option is useful to keep track of statistical information for histograms, produce averages of result sets, or change the interface based on control values or results from the inspection. Refer to Customizing an Inspection Interface in NI Vision Builder for Automated Inspection – Part II and Customizing an Inspection Interface in NI Vision Builder for Automated Inspection – Part III for more information on this feature.
 

Getting Started with a Custom Inspection Interface

The following exercise demonstrates how to use a custom Inspection interface template for your Vision Builder AI inspection. Complete the following steps to take an existing inspection and modify it to use a custom Inspection interface template for the Inspection interface.

Loading an Inspection

Complete the following steps to open the Tutorial 1 - Coordinate System.vbai inspection.

  1. Launch Vision Builder AI, and click Configure Inspection to load a blank Vision Builder AI inspection.
  2. Select File»Open from the Vision Builder AI toolbar.
  3. Navigate to <Vision Builder AI>\Examples\ Tutorial 1 - Coordinate System.vbai.
  4. Click OK to open the inspection.
 

Running the Inspection

After you open the inspection, run the inspection to observe its behavior. Complete the following steps to the run the inspection and better understand the structure of the inspection.
 

Click the  Run Inspection Once button to run one iteration of the inspection.
 

The inspection executes the following steps in order:

  1. Acquire Spray Bottle–Loads the image of the spray bottle
  2. Locate Sprayer Base–Uses pattern matching to find the base of the sprayer
  3. Set Coordinate System–Sets a coordinate system based on the location of the sprayer base.  The coordinate system allows the inspection to measure features on the sprayer even if the sprayer moves
  4. Check Cap Presence–Measures the intensity of the location of the cap to ensure a cap is present
  5. Set Inspection Status–Sets the status of the inspection

Opening the Inspection Interface

You can run inspections in either the Configuration interface or Inspection interface. The Configuration interface is used primarily for development and debugging. The Inspection interface is used when the inspection is deployed. Since the Inspection interface does not display debugging information, it typically runs faster than the Configuration interface.

Complete the following steps to run the inspection in the Inspection interface.

  1. Select File»Switch to Inspection Interface to switch to the Inspection interface.
  2. Click the  Start Inspection button to begin running the inspection.
     

Note: The default Inspection interface displays the image, results of individual inspection steps, and other statistical information about the inspection.
 

  1. Click the  Stop Inspection button to stop the inspection.

  2. Select Inspection»Switch to Configuration Interface to re-open the inspection in the Configuration interface.
     

Using a Custom Inspection Interface

The default Inspection interface displays information about the inspection. However, you may wish to display different information in the Inspection interface. Complete the following steps to configure the inspection to use a custom template interface as the Inspection interface.

  1. Select Tools»Inspection Interface Configuration to launch the Configure Inspection Interface dialog box.
  2. On the Inspection Interface tab, select the Create New Custom Inspection Interface from: option.  
  3. Select Template Inspection Interface.
  4. Select the One Image Display Indicator and Pass Fail Indicator template.
     

The Configure Inspection Interface dialog box should now resemble Figure 1.

Figure 1. Configure the Inspection Interface
 

  1. Click OK to close the Configure Inspection Interface dialog box. Vision Builder AI includes the interface with the inspection to make the inspection more portable. The selected interface is displayed when you switch to the Inspection interface.
     

Updating Indicators in the Custom Inspection Interface

Complete the following steps to update the indicators on the Custom inspection interface.

  1. In the State Configuration window, click  Set Inspection Status step. This ensures that the next step you add is placed immediately after the Set Inspection Status step.
  2. In the Inspection Steps Palette, select the  Use Additional Tools tab.
  3. Click the  Update Inspection UI step. The property page for this step opens.
  4. In the Inspection Interface table, select # Fail.
  5. For the Operation, select Set to Measurement.
  6. In the Measurements tree, choose Variables»System Variable»# Fail.
  7. Set the values of the # Parts Inspected, Pass, and Yield (%) indicators to their corresponding system values in the Measurements tree.  
  8. Set the value of the Image indicator to Current Image.
  9. Set the value of the Inspection Status indicator to Variables»System Variables»Inspection Status.
  10. Set the value of the Text indicator to State: Inspect»Step #1: Acquire Spray Bottle»Current Image Path.  

The Inspection Interface indicators table should resemble Figure 2.

Figure 2. Assigning measurement results to indicators on the Custom Inspection Interface
 

  1. Click OK to add the Update Inspection UI step to the inspection.
  2. Select File»Save As and save the inspection as Tutorial 1 – Coordinate System with UI.vbai.
  3. Select File»Switch to Inspection Interface to switch to the Inspection interface. Notice that Vision Builder AI now uses the custom Inspection interface instead of the default Inspection interface.
  4. Click the Start Inspection button to run the inspection. Notice that the indicators on the custom inspection interface update with the inspection results.
  5. Click the Stop Inspection button.
  6. Select Inspection»Switch to Configuration Interface to return to the Configuration interface.
     

Using a Web Server on a Remote Target

Accessing an inspection through a Web browser is only available for inspections running on remote targets. Using a Web server provides an easy way to view the custom Inspection interface running on the remote target from any PC using a Web browser without requiring any additional software to be installed. The web page will automatically attempt to install the LabVIEW Run-time Engine and Vision Run-time Engine if they are not already installed.

Note: It is not necessary to install the Vision Run-Time Engine, which will require activation after 30 days, to view the inspection through a web browser on the remote target. Instead, you can view the inspection from the remote target by installing the Vision Common Resources. This Vision Common Resources Run-Time will provide the necessary components needed to view the inspection and does not require a license. If you don't install the Vision Run-Time Engine or the Vision Common Resources and just have the LabVIEW Run-Time Engine installed, you will be able to see your inspection controls and indicators updating but will not be able to see the acquired image.
 

Connecting to the Target

Complete the following steps to connect to a remote target using Vision Builder AI.

  1. Go to the welcome screen of Vision Builder AI.
  2. If you are connected to your target, proceed to step 4. Otherwise, in the Execution Target control, select Select Network Target.
  3. Select a remote target from the list of available remote targets and click OK. If the desired remote target is not included in the list, select Add Target and enter the IP address of the remote target.
     

Note: You may need to click the Configure button and complete the Remote Target Configuration Wizard to ensure the remote target is running Vision Builder AI. After you have verified the target is running Vision Builder AI, click OK.

  1. On the Vision Builder AI inspection screen, click Configure Inspection.
     

Copying the Inspection to the Target

Complete the following steps to copy the modified inspection from the development computer to the target.

  1. Select Target»Add/Retrieve Inspections on the Vision Builder AI toolbar to launch the Inspection Manager dialog box. 
  2. Navigate to <Vision Builder AI>\Examples\Tutorial 1 - Coordinate System with UI.vbai, and click Copy.
  3. Click Done to copy the inspection to the target and close the Inspection Manager Dialog box.
  4.  On the Vision Builder AI toolbar, select File»Open, and select Tutorial 1 - Coordinate System with UI.vbai, and click OK.
 

Configuring the Web Server

Configuring the Web server allows you to specify if a Web server is running on the target and the level of read or write access other computers can have to the remote target using the Web server. The more computers viewing an inspection using the Web server, the slower the inspection will run, especially if the computers are on remote subnets. NI recommends that you only grant access to machines that need to use the interface to avoid unnecessary network traffic on the Web server.

Complete the following steps to configure the Web server on a remote target.

  1. On the Vision Builder AI toolbar, select Target»Target Options to launch the Remote Target Options dialog box.
  2. Select the Web Server category.
  3. Select the box to enable the Web Server.
  4. Enter the IP address of the computer you want to view or control the inspection in the Browser Address control, and click Add. You can add multiple IP addresses to allow access to more than one computer. You can add * to grant access to all machines. If you want the computer to control the interface, select the Allow Viewing and Controlling option. You may choose to give some IP addresses viewing and controlling privileges, others only viewing access, and others no privileges at all. The viewing and controlling access options are only useful if the Inspection interface contains controls that can be updated. Using controls on the Inspection interface is discussed in the next tutorial, Customizing an Inspection Interface in NI Vision Builder for Automated Inspection – Part II.
  5. Click OK to close the remote target options dialog box.

The Web server is now enabled.

  1. Select File»Switch to Inspection Interface to switch back to the Inspection Interface.
  2. Click the Run button to begin the inspection.
 

Viewing the Inspection in a Web Page

  1. Launch a Web browser and enter the URL http://<IP Address of Target>:8000. If you don't specify port 8000 you will be taken to the normal web interface and not the VBAI inspection. You may be prompted to install the LabVIEW Run-Time Engine and the Vision Run-Time Engine before you can view the inspection, but this only needs to be done the first time if the software is not already installed. You can install the Vision Common Resources instead of the Vision Run-Time Engine to avoid having to license the product, please see the note at the beginning of this section.
  2. If a computer running Vision Builder AI is connected when the custom Inspection interface appears, a computer cannot control the Web page. In Vision Builder AI, select Inspection»Close, and click No, Close Only to enable the inspection to continue running on the remote target.
  3. If the computer viewing the inspection is allowed to control the inspection, right-click the Web page and select Request Control. If the Inspection interface has controls, you would now be able to change the control values using the Web page.
  4. To stop an inspection that has the Web server enabled you must first connect to the remote target running the inspection using Vision Builder AI.  This forces any Web pages currently controlling the inspection to lose their connection and give Vision Builder AI control.
  5. Click Stop to stop the inspection.
Continue to Customizing an Inspection Interface in NI Vision Builder for Automated Inspection – Part II and Customizing an Inspection Interface in NI Vision Builder for Automated Inspection – Part III to learn more about using Custom Inspection interfaces in your inspections. Part II uses a LabVIEW front panel as the Inspection interface and uses controls on the Inspection interface to change how the inspection flows. Part III uses a LabVIEW front panel to change the pass fail criteria of a step.