08-19-2019 06:42 PM
Hi Friends,
I have a while loop for data collection followed by an interpolation data process. I want the data process still work after the stop button is clicked to stop the data collection while loop.
The program worked fine when a for loop was used for data collection, however, the interpolation data process stopped working after replacing the for loop with a while loop.
Please find attached two VIs and and input are appreciated.
Thanks,
Gu
Solved! Go to Solution.
08-19-2019 07:15 PM
Can you explain more what you mean about the interpolation not working? When I run your while loop version and stop it after about 20 iterations, I get an output that looks very similar to your for loop version. So I'm not sure what exactly the problem is.
08-19-2019 07:18 PM
I feel a little bit silly suggesting this, but I just want to make sure: you are pressing the "Stop" button and not the "Abort Execution" button right?
08-19-2019 07:27 PM
I tried this using LabVIEW 2018 and it seemed to work fine. I had a little difficulty stopping the While Loop at 20 iterations, so I "cheated" and replaced the Stop button with an "is equal to 20" comparison that looked at the XY Graph Count. Note that you might have "fooled yourself" as the Array indicator on the "While" version is looking at elements 30 and above, all of which are null, while the "For" version starts looking at Offset 0 and sees data.
I also tried this with LabVIEW 2016 (the oldest I have conveniently available) and saw the same thing.
Bob Schor
08-19-2019 07:58 PM - edited 08-19-2019 08:01 PM
Hi All Guys who replied and reviewed my post,
Yes, the two versions work the same.
I tried the while loop version immediately after changing the for loop version to the while loop version, it did not work. The interpolation was not executed.
However, after my supper and reading the 3 replies, I reloaded the while loop version and run it realizing that it works fine. The issue might be related to my computer issue rather the code. I closed the while loop VI and also LabVIEW program for supper, it just work fine after reload LabVIEW and the VI.
I am sorry for troubling all of you guys.
Gu