LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

initial values in controls read from file on PDA, is this possible?

The heading pretty much say it all.  I am trying to initialize controls in a vi with values read from a file.  I understand that the property node does not work on the PDA version (which really sucks but anyhow) but I was wondering if anyone has any ideas on how I can achieve this.  This is a configuration vi which will save the configuration information to a file, I would like it to initialize to the previous values when it is opened next.  Is this possible??  Thanks for any help.

Greycat
0 Kudos
Message 1 of 7
(4,427 Views)
Why not to use local variables? From your vi, you may return the initializing values, separately or in a single cluster, and set all relevant controls.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 2 of 7
(4,416 Views)

Are you using 8? I know that some properties (and methods?) are supported there and that variants are supported as well.
Is it possible to use the Set Control Value (Variant) method? If it is, then you might be able to do the same thing done in the OpenG save panel to INI file VI.

If not (and this is probably the more likely case), why not use local variables? You can either flatten all your control data to a single string (look in the advanced palette) and later unflatten it and put the data into the locals or you can work with a more flexible structure by using something like an INI file.


___________________
Try to take over the world!
Message 3 of 7
(4,415 Views)
Of course!!!!   Local variables ... seems quite obvious now but that thought never even entered my mind.  Thanks to Paolo and tst for answering the question.  Works just fine  Smiley Tongue

Greycat

0 Kudos
Message 4 of 7
(4,411 Views)
Hi,

I am working on a similar case where I want to save the calibration settings on a PDA and then reload them when the program is run again. I understand that you guys have recommended using local variables for the task but I cant figure out how. Is it possible if you could provide a sample VI showing this implementation.

Greatly appreciate your help

Thanx
0 Kudos
Message 5 of 7
(4,274 Views)

Attached is a highly simplified example. It is only supposed to show the concept and I didn't test it. You will need to expand it to support more variables. To be more clever about it, you can use a typedef cluster and do this in subVIs.

It's possible that 8.2 supports the Label.Text and Value property nodes and that then you can get a more generalized solution.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 6 of 7
(4,262 Views)

Thanks a lot for the example.  I have used the idea of config file before but since you had mentioned local variable rather than a config file, I assumed that it might be something else.

~Zulfi~

0 Kudos
Message 7 of 7
(4,253 Views)