LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue Reading Spreadsheet Updated Values

Solved!
Go to solution

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.

0 Kudos
Message 1 of 8
(2,659 Views)

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.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 8
(2,636 Views)

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?

0 Kudos
Message 3 of 8
(2,633 Views)

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)

 

 

 

 

 

 

Limits Debug.png

0 Kudos
Message 4 of 8
(2,628 Views)

Maybe this uninitialized shift register?Maybe this uninitialized shift register?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 8
(2,625 Views)
Solution
Accepted by jlaijames

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.

========================
=== Engineer Ambiguously ===
========================
Message 6 of 8
(2,615 Views)

There are quite a few uninitialized shift registers  (Cases "TVFIL",  "TVFREJ",  "PWR"). You can replace them with globally initialized feedback nodes or play with the "first call?" primitive.

Message 7 of 8
(2,610 Views)

That was it! I noticed the issue while debugging something else also. Thanks a bunch!

0 Kudos
Message 8 of 8
(2,604 Views)