Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

VBAI: how do I read a shared variable?

Solved!
Go to solution

I am trying to make my inspection to do things that are contingent on the value of Shared Variables. It is obvious how to set the Shared variables from VBAI, but I have not figured out how to read them and then create some kind of a CASE structure using that variable.

 

Any ideas on how to implement such an architecture?

0 Kudos
Message 1 of 3
(3,254 Views)
Solution
Accepted by topic author Jan_d.

I would create two different states and use transitions that are based on the shared variable value. You can read the value of variables or previous measurements in steps that allow this (not all steps do, but most do) or transitions. To create a new state, go to the state diagram (click on the "Toggle Main Window View" so the state diagram is in the main part of the window). Right click in an empty part of the state diagram and select "Create New State".

To create a transition, right click on a state and select "Create New Transition" and drag the transition to the new state.

To edit the transition, double click on it and you will be able to select the shared variable as the measurement, along with comparison operations to make the decision. If this comparison evaluates to False, the Default transition will be taken instead.

Select Help>>Show Context Help while editing the state diagram to get more details on how to use it.

 

Hope this helps,

Brad

Message 2 of 3
(3,252 Views)

Thanks Brad, that's works wonderfully. I guess I am still too new to VBAI to figure this out on my own...

0 Kudos
Message 3 of 3
(3,246 Views)