LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Store cluster (in global variable) to file (and read it back)

I have an application to configure a large number of different instruments. The configuration is stored in a global variable which contains a cluster for each instrument (or array of clusters if more than 1x the same instrument) the clusters contain mostly boolean, double and integer values.

I would like to save this complete setting to a file, and of course also read it back to this global variable.

Do you have any suggestions how this can be done?

Christian
0 Kudos
Message 1 of 4
(3,960 Views)
Hi Christian,
      Here's a quick-and-dirty VI to do what you requested.  Just replace the in and out clusters with yours.  It's quick, as you can see, but "dirty" in that the file will not be readable with a text-editor.  ALSO, you won't be able to read the saved data if the cluster type-definition changes!  Maybe that's OK.  It's a bit (OK, a Lot) more work, but there are tools for saving readable/named settings in FILE I/O\Configuration Files palette.  A "slick" way to save info between runs is to store right in the Windows registry (assuming you use Wndows.  See Advanced\Windows Registry Access.
 
Cheers
When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 2 of 4
(3,949 Views)
Hi!

Thanks for your suggestions, I think I think I can live with the fact that I can't alter the cluster definition. I first also considered to use the configuration file functions, but as you said, it is a lot of work.

Best Regards
Christian
0 Kudos
Message 3 of 4
(3,932 Views)

@superelo wrote:
I first also considered to use the configuration file functions, but as you said, it is a lot of work.

Luckily, that work has been already been done. Check out OpenG's config files toolkit (download the commander).

___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(3,915 Views)