Run LabVIEW VI FAQs

NI Vision Assistant

Run LabVIEW VI FAQs

What types of controls and indicators can I use in my VI?

There are no restrictions about the types of controls or indicators you can use in the VI. However, to use measurements from a previous Vision Assistant step or set constant values, the controls must be numerics (I8, I16, I32, U8, U16, U32, DBL, SGL, or EXT), strings, Boolean values, or IMAQ Image controls. Indicators must be numerics, strings, or Boolean values to be accessible in future steps.

Do I need to update the connector pane for this step to use my indicators or controls?

Yes, the Run LabVIEW VI step can only use controls and indicators that are connected on the VI connector pane.

How do I use the current image from Vision Assistant and modify the image so subsequent steps use the modified image?

In the VI Controls tab, click Configure. If you have an IMAQ Image control on the specified VI, select Images»Current Image as the value for the IMAQ Image control. When the current image is associated with your image control, you can access the current Vision Assistant image. Any modification to the image is reflected in the resulting image after the VI is run. Image Buffer steps that store images are also accessible to the Run LabVIEW VI step.

Note  If an image from an Image Buffer step is modified by the Run LabVIEW VI step, all subsequent steps that use that Image Buffer also use the modified image.

Because the image passed in is the same one to be modified, using an image display control can produce confusing results because it may not be clear if the image displayed is the original passed from Vision Assistant or the modified version after the VI has run. National Instruments recommends that you use the IMAQ Image control instead of the IMAQ Image Display control to avoid confusion.

Note  If you pass the current Vision Assistant image to your VI, overlays in the image are preserved. However, any calibration information from previous steps is lost.

Why does Vision Assistant appear unresponsive when I run a VI?

The Run LabVIEW VI step waits for the specified VI to complete before executing additional steps in the application. If the VI runs continuously or requires a user interaction to stop the VI, the step waits indefinitely. To avoid this situation, be sure that the selected VI can complete without user interaction.

Why do I get an error about my VI or one of the subVIs being broken?

You need to save the VI for distribution to ensure that all the VI dependencies are available. Refer to Saving a VI for Distribution for instructions about saving a VI for distribution.

When I generate the LabVIEW code for my script containing a Run LabVIEW VI step and run the generated VI, I do not get the same results that I get in Vision Assistant. Why?

The only controls connected to the VI in the generated code are the image input and error clusters. You must connect the other controls manually. First, identify the VI that produces the value you want to connect to the control. If the value is a simple numeric, Boolean, or string, wire the output to the corresponding control on your VI. If the value is contained in an array or cluster, first use the LabVIEW primitives Index Array and/or Unbundle to access the value. Then, wire the output to the corresponding control on your VI.