04-26-2013 05:57 AM
I am using LV2010 and VBAI2011.
I am using LV to write vi for my VBAI user interface. VBAI will send the inspection results to vi by "Update Inspection UI".
I am calling a "Run LabVIEW VI" from within the VBAI. This vi contains a sub-vi "Read From Spreadsheet File.vi"; the "file path" input to this sub-vi is a string control, which will be updated by a string value obtained in previous steps.
What happen is, when I run the Inspection, a windows "Choose File to Read" will pop up, even though I have already update the "file path" in VBAI. I guess this happens because the "Read From Spreadsheet File.vi" sub-vi didn't wait for the "file path" input, or rather the "file path" update was "too slow"
How to prevent this from happening?
Solved! Go to Solution.
04-26-2013 07:35 AM
You will get the pop-up dialog box in two cases: either the file path is empty or is <Not A Path>. Is it possible for you to create an indicator on the front panel and make sure it's neither of the two? Let us know what you find.
04-26-2013 10:44 AM
Nope, its neither of the two. It did show a valid file name with full path.
Let me describe in more detail what the problem is:
In my VBAI, I call two VIs one after another. First I call PQT_Latest_Calibration_File(Int).vi (attached here), then I call PQT_CurveFitting_Lookupxxx.vi (attached in my previous message).
PQT_Latest_Calibration_File(Int).vi search a particular directory and all its sub-directory to look for a file. It returns this filename with full path
PQT_CurveFitting_Lookupxxx.vi makes use of the filename returned by the previous VI, and do something..
When run alone, PQT_Latest_Calibration_File(Int).vi will show correct filename with full path on Front Panel.
But when the two VIs are called one after another in VBAI, a popup window happens. This windows pops up because, I think, the filename is not passed successfully (or rather too slow, or due to race condition??) to PQT_CurveFitting_Lookupxxx.vi
04-26-2013 10:49 AM
04-26-2013 01:04 PM
I didn't use your code but tried the attached simple VIs and they work well. Can you create a simple VBAI interface that just runs these two VIs and see if you are able to replicate the issue? The VIs are LabVIEW 2010 SP1
Attached is my VBAI inteface as well, which is 2011 SP1.
04-26-2013 01:11 PM
Did you try using the String output of the PQT_Latest_Calibration_File(Int).vi instead of the path output? There is a bug that is fixed in VBAI 2012 where file path indicators are not updated correctly in Run LabVIEW steps. Try using the result of the string path instead of the file path and this should fix your problem.
Thanks,
Brad
04-26-2013 01:19 PM
Hmm I don't think it's a bug. The Help clearly states that
However, to use the value of a variable or measurements from a previous Vision Builder AI step for the value of a control, the control data types must be numerics (Enum8, Enum16, Enum32, Enum64, I8, I16, I32, I64, U8, U16, U32, U64, DBL, SGL, or EXT), strings, boolean values, NI Coordinate Systems, or NI Image controls. Indicators must be numerics, strings or boolean values to be accessible in future steps.
I don't think path indicators are supported (atleast in VBAI 2011 SP1). They definitely don't show up in the list of measurments.
04-26-2013 01:46 PM
Good point. I got 2011 and 2012 confused. I think it was a problem in 2012 and it got fixed in 2012 SP1. Anyway I tried using those VIs in an inspection and I got errors with the second VI because it has dependencies on a File I/O vi in a lvlib, so I built a simple project to include all dependencies like the Help recommends and then I could call the built version of those VIs without problems (I simplified the first one to return a fixed path), and the second VI was able to use the results of the first VI without problems, so maybe I'm missing something. If the attached example works and yours doesn't, please include a simple inspection with your directory of text files to reproduce this problem.
Thanks,
Brad
04-27-2013 12:59 AM
Hi Adnan,
I download and run your VBAI.
When I first run it, I still got a pop up asking "Choose File to Read" (see attached).
You didn't get the same pop up?
04-27-2013 01:11 AM
Hi Brad,
No luck running your programs also.
I still get the pop up asking for "Choose File to Read".
Did I miss anything.. 😞