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.
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.
- Launch Vision Builder AI, and click Configure Inspection to load a blank Vision Builder AI inspection.
- Select File»Open from the Vision Builder AI toolbar.
- Navigate to <Vision Builder AI>\Examples\ Tutorial 1 - Coordinate System.vbai.
- 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:
- Acquire Spray Bottle–Loads the image of the spray bottle
- Locate Sprayer Base–Uses pattern matching to find the base of the sprayer
- 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
- Check Cap Presence–Measures the intensity of the location of the cap to ensure a cap is present
- 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.
- Select File»Switch to Inspection Interface to switch to the Inspection interface.
- 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.
- Click the Stop Inspection button to stop the inspection.
- 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.
- Select Tools»Inspection Interface Configuration to launch the Configure Inspection Interface dialog box.
- On the Inspection Interface tab, select the Create New Custom Inspection Interface from: option.
- Select Template Inspection Interface.
- 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
- 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.
- 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.
- In the Inspection Steps Palette, select the Use Additional Tools tab.
- Click the Update Inspection UI step. The property page for this step opens.
- In the Inspection Interface table, select # Fail.
- For the Operation, select Set to Measurement.
- In the Measurements tree, choose Variables»System Variable»# Fail.
- Set the values of the # Parts Inspected, Pass, and Yield (%) indicators to their corresponding system values in the Measurements tree.
- Set the value of the Image indicator to Current Image.
- Set the value of the Inspection Status indicator to Variables»System Variables»Inspection Status.
- 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
- Click OK to add the Update Inspection UI step to the inspection.
- Select File»Save As and save the inspection as Tutorial 1 – Coordinate System with UI.vbai.
- 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.
- Click the Start Inspection button to run the inspection. Notice that the indicators on the custom inspection interface update with the inspection results.
- Click the Stop Inspection button.
- 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.
- Go to the welcome screen of Vision Builder AI.
- If you are connected to your target, proceed to step 4. Otherwise, in the Execution Target control, select Select Network Target.
- 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.
- 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.
- Select Target»Add/Retrieve Inspections on the Vision Builder AI toolbar to launch the Inspection Manager dialog box.
- Navigate to <Vision Builder AI>\Examples\Tutorial 1 - Coordinate System with UI.vbai, and click Copy.
- Click Done to copy the inspection to the target and close the Inspection Manager Dialog box.
- 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. National Instruments 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.
- On the Vision Builder AI toolbar, select Target»Target Options to launch the Remote Target Options dialog box.
- Select the Web Server category.
- Select the box to enable the Web Server.
- 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.
- Click OK to close the remote target options dialog box.
The Web server is now enabled.
- Select File»Switch to Inspection Interface to switch back to the Inspection Interface.
- Click the Run button to begin the inspection.
Viewing the Inspection in a Web Page
- Launch a Web browser and enter the URL http://<IP Address of Target>. 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.
- 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.
- 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.
- 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.
- 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. Additional Vision Builder AI examples provide sample inspections that demonstrate more advanced uses for the custom inspection interface.