Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Reset System Variables in VBAI

Solved!
Go to solution

Is there a way to reset the System Variables - mainly #Parts Inspected, #Pass, #Fail?

 

I have an Inspection Script that measures set in a coil of band saw material.  As it is running, the UI dislplays the #Pass & #Fail and plots the set measurements on a Sweep chart.  Once the coil is done, I need to be able to reset the #Pass & #Fail and get the Sweep chart to go back to zero.  I can create my own Inspection Variables for the Pass/Fail, but that seems reduntant and it also does not reset the Sweep chart.

0 Kudos
Message 1 of 5
(4,322 Views)

From the inspection interface, you can do it from the inspection menu (Inspection>>Reset Inspection Statistics).

Right now, it is not currently possible to reset them "programmatically" from the state diagram. Is that what you wanted to do?

 

-Christophe

0 Kudos
Message 2 of 5
(4,320 Views)
Yes, either from the script or the User Interface.  The only other way I can think of is to use the Select Inspection, but it would be selecting itself and I'd rather not go that route unless I have to.
0 Kudos
Message 3 of 5
(4,318 Views)

Also, the Reset Statistics does not clear the Sweep Chart, it just keeps going from where it stopped so now the X-axis on the chart does not match the #Pass, #Fail dislayed.

0 Kudos
Message 4 of 5
(4,316 Views)
Solution
Accepted by CW_Edge

You will need to keep track of your own #Pass/#Fail and not use the built-in system variables (since the built-in variables don't behave like you want). You can also put a property node in your Custom UI code and Run the VI from the Update Inspection UI step to reset the chart history when a boolean is true and you set this hidden boolean to true when you want the strip chart to reset.

 

Hope this helps,

Brad

0 Kudos
Message 5 of 5
(4,312 Views)