I have a large Test Program VI that takes data/measurements and calls an excel spreadsheet file to read the limits. I have a subvi that requires the Test ID as an input in order to find the limit in the excel file for each specific test. The issue I am seeing is that if I make an update to the limit file and rerun my test program, for some reason it still reads the old limit values. However, it reads the correct updated values if I run the subvi outside of my test program. Furthermore, the test program will read the correct updated values if I just disconnect any wire and reconnect it before running the program.
Solved! Go to Solution.
Without seeing your code we can only guess that the previous values are being retained between runs.
This may only happen when running from the development environment, as once you compile it each run of the executibile will be "fresh".
But in reality you should initialize all variables and shift registers to a known state at the beginning of your program to avoid issues like this.
My guess is too that you have some stale values in an uninitialized shift register. These would only get cleared during the same edit session if the VI is recompiled (which any small edit would do).
Can you show us some code?
Okay my program is attached. The picture below shows where I am reading the incorrect limit values. (Sorry for the messy VI, I am still developing/debugging)
Some reason my edits to my post are not being applied...
But that uninitialized shift register is going to remain in the "DONE" state after your first run unless the VI is recompiled or closed and opened.
On the first run it will go to the "default state" because the shift register is empty, but on the second and any run after that the shift register will be holding the "DONE" value so it will only run the DONE state.
So on the next run it will not actually do any of that part of the program and you will be left with the data from the last run.