LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Idea to modify config file vi's

Hi Everyone,

I am thinking of modifying the standard config file vi's and would like some feedback on the idea before I start.  Currently I tend to use a FGV to store config options in my vi's.  This way I can open the file, read the keys and store them in a cluster in the FGV and then read and write the keys from anywhere in my application.  This is OK, but it has two drawbacks: 1, Adding a key to the file means modifying the FGV and the cluster type def. and 2, I need one FGV per file.

Now I need a much more scalable approach but I don't want to have to pass the config file reference everywhere. 

Having looked at the 2009 config file vi's I see they almost do what I want anyway.  The ini reference is actually a queue reference to a single element queue which holds the config file data.  So what I am thinking is this:  Modify the functions so instead of a reference being used, the queue name is utilized. This way you would use the open config file VI and assign a name (I would use the top left terminal where the reference currently lives). Thereafter, the keys would be accessed using the name instead of the reference.  It would become very easy to add keys as necessary, and access the data from any sub VI's processes or daemons in the project.

 

I have also thought about functions such as 'read section', but of course the problem is data types.  Common sections that are often used in one place could be configure serial port, configure DAQ or instrument calibrations.

 

I can also see a use for storing arrays in ini files, formatted: {1,2,3,4,5}, and passing them to labview as an array, I would use this for non linear calibration curves so would only envisage implementing for double.

 

I would welcome any feedback, it would be good to at east try to get this right the first time!  Of course if I do come up with anything useful I will share with the community Smiley Happy

 

Michael.

0 Kudos
Message 1 of 2
(2,385 Views)

You could utilize the 'Dictionary VIs' from OpenG.org, they create name-value pairs based on Variants allowing an endless data storage.

 

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 2
(2,374 Views)