cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Issue Reading Spreadsheet Updated Values

Solved!
Go to solution
Highlighted

Issue Reading Spreadsheet Updated Values

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
(208 Views)

Re: Issue Reading Spreadsheet Updated Values

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.

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 2 of 8
(185 Views)

Re: Issue Reading Spreadsheet Updated Values

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?


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 3 of 8
(182 Views)

Re: Issue Reading Spreadsheet Updated Values

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
(177 Views)

Re: Issue Reading Spreadsheet Updated Values

unitCapture.PNGMaybe this uninitialized shift register?

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 5 of 8
(174 Views)
Solution
Accepted by topic author jlaijames
06-13-2018 12:57 PM

Re: Issue Reading Spreadsheet Updated Values

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.

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
Message 6 of 8
(164 Views)

Re: Issue Reading Spreadsheet Updated Values

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.


LabVIEW Champion Do more with less code and in less time
Message 7 of 8
(159 Views)

Re: Issue Reading Spreadsheet Updated Values

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

0 Kudos
Message 8 of 8
(153 Views)