Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert Variables from 1 state to another in VBAI

Solved!
Go to solution

Good day again NI experts,

 

I have a problem about needing to use data from 1 state into another in VBAI. In my program attached, I have 3 Barcode reading States in a Loop. If "Matrix Bot Bk1" fails, "Matrix Bot Bk2" will read and if it also fails, "Matrix Bot Wt" will read and if it fails, the program will loop back to "Matrix Bot Bk1" until 1 succeeds then proceed to the next State where I will process the Barcode reading. Based on the program loop, only 1 of 3 Barcode readings should pass.

 

I've made this program because I need to read Barcode data from different PCB materials where I also need to control 2 lightings, White and Blue. The problem is that in the next State where I will process the data, In the calculator step, I can't see the VARIABLES FROM PREVIOUS STATES. Hope you can help me with my problem. Thank you very much.


Sincerely,

Andrei K.

Download All
0 Kudos
Message 1 of 3
(2,677 Views)
Solution
Accepted by topic author andrake

You can create a variable from Tools>>Variable Manager, and then use the Set Variable step to set the barcode string to this variable in each of the steps. This variable will have the barcode string value of the step that last updated it, so you can use this variable in the Calculator step in a different state. We hope to have the Calculator step able to access previous results from different states in a future release, but until then, you can use Variables.

 

Hope this helps,

Brad 

Message 2 of 3
(2,675 Views)

Mr. Brad,

 

Again, thank you so much for your help.


Sincerely,

Andrei K.

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