Example Code

Dynamic Step Input Using Variables in VBAI

Code and Documents

Attachment

Overview


This example demonstrates a method for dynamically updating step inputs using variables in VBAI. Using the Set Variable step, the results of a step or state can be used to determine the step inputs on the next iteration of a different state in a VBAI inspection.

A simple method of symmetrical part inspection is as follows:

  1. Take an image
  2. Run an inspection with static references to inspect one region of a symmetrical feature
  3. Physically reposition the part

This process is repeated until the whole symmetrical feature has been inspected with the required resolution. This type of inspection could be used, for example, to inspect the wall thickness of a cylindrical part (aluminum can, barrel, bullet casing, plastic container , etc...)

By using the variable functionality in VBAI, you can decrease your imaging requirements and perhaps even simply your physical inspection setup.

Using variables, you can take a single image, then repeat the following procedure until the whole feature has been inspected with the required resolution:

  1. Run an inspection with a dynamic references to inspect complete symmetrical feature
  2. Update dynamic references using VBAI variables  

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors