LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Retaining Previous Data - Global to Cluster Control

Solved!
Go to solution

I needed to input a bunch of information at the beginning of my labVIEW program with the following structure:

Commerical Equipment

 Function Generator

  Manufacture

  Model#

  Serial#

  Calibration Date

 Chart Recorder

  Manufacture

  Model#

  Serial#

  Calibration Date

 Digital Voltmeter

  ....

Equipment Under Test

 ...

 

So I created a subVI for this input using a Cluster of clusters of string controls.  If something goes wrong or you close the program you have to input all the info again.  I am trying to use a global variable to store my cluster.  When I start the program I'd pull from the global the last data entries.

 

How can I read the global to the control cluster without unbundling and bundling a mess?

 

thx

 

 

Download All
0 Kudos
Message 1 of 10
(4,313 Views)

A Global will not retain the values from one program execution to next program execution.

You need to save the values outside the program, file, database or something else if you what to program to "remember" the values.

 

If you just what to share data between different modules/code in your program, then make your Global a type of the same type def as shown to your user, then it is just a matter of wire. 

Message 2 of 10
(4,304 Views)

Basically there are 2 options, non of them involves a global variable:

  1. The simple and amateur way: you use your VI as it is, and run it from the dev environment. In this case you can just use the "set as default" feature on this cluster control. If you have to restart/reopen your VI, you can get the default values by right click and choosing the "initialize to default" option.
  2. Pro way: use configuration file. Search for the term: "LabVIEW configuration file". You can program it yourself, or you can use ready made toolkits, like the one from MGI (MGI Save/Restore Front Panel Data VI).
0 Kudos
Message 3 of 10
(4,299 Views)

Look over the Configuraion File VIs.  They are excellent for this purpose.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 10
(4,284 Views)

If I were to store this in a file which would be simpler 'ini' or 'xml'.  I'd just like to enumerate the controls in the clusters and send them out instead of unbundling each one.  Is something like that possible?

 

thx

0 Kudos
Message 5 of 10
(4,277 Views)
Solution
Accepted by Regulator

Look into the GXML library.  It should do exactly what you are asking for.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 10
(4,257 Views)

Using XML was the ticket! Thx

 

0 Kudos
Message 7 of 10
(4,210 Views)
Hi all...

I agree with the above method of using configuration file...

In some of my previous projects for a scenario something like the same, I used binary file which will store and retrieve cluster data in the same format as expected...
what is the difference it will create in execution between ini file and binary file

Regards
Palanivel Thiruvenkadam
0 Kudos
Message 8 of 10
(4,174 Views)

@palanivel wrote:
In some of my previous projects for a scenario something like the same, I used binary file which will store and retrieve cluster data in the same format as expected...
what is the difference it will create in execution between ini file and binary file

If all you care about is pure execution speed, the binary will actually be faster.  But it will not be that much faster and this is really only done at setup, so it really just becomes mute.  However, what if you have to make a change to your cluster?  It is a lot easier to recover from this with the XML than a binary.  The XML also allows for a user to update values in a text editor.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 10
(4,147 Views)
Thanks "crossrulz" for giving clarity for my confusion...
0 Kudos
Message 10 of 10
(4,119 Views)