From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving/retrieving a indicator value in a configuration file.

Solved!
Go to solution

I've been using the config file vi's to save the values of some indicators and controls on closing the program and repopulating them at startup. This has worked well but  now I've run into a problem. I have an indicator for a timer that displays in hours:minutes. When the value is saved it shows in the file as the correct time in seconds. When I try to populate the indicator from the file a probe shows the correct value (in seconds) going to the indicator's local variable but the indicator itself remains at zero. I've tried using both local variables and a property node/value with the same results. Any ideas how to get this to work?

 

 

0 Kudos
Message 1 of 6
(3,306 Views)

Can you show / upload the code where you load this data in?

0 Kudos
Message 2 of 6
(3,304 Views)

Are you using a timestamp control?  If so, you only need to convert the timestamp to a double and write it to file.  Then when you read it back in, convert it to a timestamp and wire it to your control/indicator. 

Example_VI_BD.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 6
(3,288 Views)

gregoryj - here's a part of the code the rest is too large and has too many references and variables to upload. This is how it's being written to and read from the file :

 retrieve.PNGTo answer the other question no it is not a time stamp but a numeric indicator configured to display relative time.Block config.PNG

0 Kudos
Message 4 of 6
(3,265 Views)
Solution
Accepted by topic author GDthomas

Hi RT,

 

Part of the reason I wanted to see the code is to see how the control display is configured and if you might have any race conditions present.

0 Kudos
Message 5 of 6
(3,258 Views)

Well Gregory that solved it. No race conditions but you got me thinking and as it turns out that it's populating the indicator just fine. Problem turned out to be immediately after that the first thing the timer part of the code does is write the current time to it, which is zero. Thanks for getting me to look at the problem from a different angle.

0 Kudos
Message 6 of 6
(3,249 Views)