08-14-2011 11:22 AM
I called the block diagrams continuously..
Now I figured out MoResee's program..
Thanks all!
08-14-2011 06:43 PM
I'm glad to hear it, but don't forget it was altenbach who originally suggested it. I just coded it for you.
08-20-2011 12:13 PM
Hi MoReese,
Seems like I still haven't got the problem solved completely..
Long story. My main program is in Vision Builder for Automatic Inspection (VBAI). I am only using the VI as an inspection interface. Anyway, seems like the 'feedback loop' method is giving me trouble.. I think when VBAI launch the VI, it is like clicking the "Run Continuously" button on the VI (I don't know why, probably that's how it work).
Anyway, I would like to stop the feedback loop after every iteration. How can I do this?
@MoReese wrote:
You must be running this in a loop. Yes, the array will fill quickly if this is the case. This was intended to execute upon a value change. In other words, you call it when there is a new value or when you want to store the next value. With every iteration, the value of the numeric control will be appended to the array. What are you needing exactly?
08-20-2011 12:23 PM
or maybe,, how can I make this a subVI and only call it once in my main VI?
Not sure if this question make sense.. I'm just a beginner. I just don't want the loop iteration to execute without my control.
08-20-2011 12:36 PM
I don't know how the call from VBAI executes, but maybe you should not initialize the node at all. (I also don't know why you would show the enable terminal, it just complicates the code.)
08-22-2011 08:47 AM - edited 08-22-2011 08:52 AM
So just wanted to clarify how Custom UI works in VBAI. When you use a custom UI, the VI is loaded into memory when the inspection is opened/loaded and the controls/indicators are initialized to the values specified under Tools>>Inspection Interface Configuration in the tab Interface Initial Values. The VI is only run when an Update Inspection UI step runs that has the checkbox selected to "Run the VI after Updating Indicators". This option is only available for VIs that have code behind the front panel. You should ensure the VI will finish quickly because the step will not continue until the VI has finished running. You could use a while loop with a constant false wired to the condition to ensure it only runs once and use shift registers to keep track of your growing array. You must use uninitialized shift registers because you don't the shift register value getting reset every time the Update Inspection UI step runs.
I created another option using a subVI that returns the full array in a single call. This is not officially supported and may not work in the future, but hopefully passing arrays will be more natively supported in the future. Here's a sample inspection that illustrates how to do this with a custom UI. You need to put the Get VBAI Step Result.vi in your c:\ drive (or update the Cust UI vi to point to th right location), and I included the custom UI VI so you can see how I call it. This subVI requires the step GUID of the step you want to get all the results for. This step GUID can be determined by:
1 - using the LabVIEW API to get info for all steps (I included a VI to illustrate how to use this method).
2 - generating LV code and digging through it to find the step GUID.
If you delete the step you want to get results for, you will need to determine the step GUID of the new step using one of these methods again.
Hope this helps,
Brad