06-30-2015 08:44 AM - edited 06-30-2015 09:01 AM
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
Solved! Go to Solution.
06-30-2015 08:51 AM
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.
06-30-2015 08:56 AM
Basically there are 2 options, non of them involves a global variable:
06-30-2015 09:00 AM
Look over the Configuraion File VIs. They are excellent for this purpose.
06-30-2015 09:07 AM
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
06-30-2015 09:26 AM
Look into the GXML library. It should do exactly what you are asking for.
06-30-2015 10:50 AM
Using XML was the ticket! Thx
06-30-2015 01:57 PM
07-01-2015 06:42 AM
@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.
07-01-2015 02:18 PM