Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

states in VBAI

Hello all,

 

     

           I'm trying to do a continous image acq and inspecting the image in VBAI. I have created a VI in labview that will count the rpm of the machine and calculate the line rate of the camera. I created three states: The first one is the VI where it will calculate the line rate and second one for acquiring the image and third one for inspecting the image and going back to the stage one for the line rate calculations. The script works fine if I use the acq and the inspected, but when I use the VI as first step, the process just sits at the first stage and never goes to second stage to acq the image. Looks like the i need to  close the labview vi after writing the line rate everytime to proceed to next state. Being a novice, I'm not sure how I need to proceed as to: as soon as the hit run inspection button, the first stage should be able to calculate and write line rate and proceed to second and third stage and back to first to calculate the line rate.

 

Attached you will find the VI code I'm working with, please provide your inputs...

 

thanks,

0 Kudos
Message 1 of 2
(3,201 Views)

The VI you run in the Run LabVIEW step cannot have a while loop that a user has to press a stop button to quit. Since the UI won't be shown and the stop button will never be presses, the VI will just sit in the while loop forever. You also shouldn't have the acquisition express VIs in the Run LabVIEW step since you will get an error about the camera already being in use since you can't open two sessions to the same camera and the VBAI acquisition step is the one that opens a camera session when you load the inspection. I would calculate the line rate without an infinite loop that requires a user to press the stop button, and use the numeric line rate caluclated by the Run LabVIEW step to set the Line Rate attribute in the acquisition step. You can use previous measurements in the acquisition step. I would also put the line rate calculation and acquisition in the same state so you don't have to use inspection variables to pass the line rate calculation from one state to another.

 

Hope this helps,

Brad 

0 Kudos
Message 2 of 2
(3,197 Views)