LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setup File / Configuration File Question

I was hoping to get some insight as to which is the recommended way of using setup files for stuff like data paths and other general parameters that the user can set like fonts and colors when they are running a compiled app (a labview app built as an exe).
 
CSV files  - open them, read them, parse them
 
INI Files - Use LabView native functions to read and write section parameters
 
XML - Not sure how much native support there is for XML.  I have seen a few example that seem to be using MSXML parser as an activeX control then sending VB code to edit the XML file.
 
Any insights would be appreciated.
 
Thanks
Tim C.
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 1 of 3
(3,046 Views)

In general, I think INI files are the easiest solution, as they already have an existing key-value interface and you can easily go in and edit\review them if necessary. If you use the OpenG Variant Configuration VIs, you can even save and load arbitrarily complex clusters.

The main problem with these is that they're plain ASCII and some users feel the urge to screw around with them. You can try encrypting the text or adding checksums to deter the users from doing this (or get their management [or common sense]) to do this.


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(3,042 Views)
My favorite method is one you did not mention - HDF5.  Its advantages
  • binary
  • fast
  • arbitrarily complex hierarchy (internal architecture is a directed graph)
  • flexible API
  • native compression, if you need huge data sets (think function generator)
  • not well known, so most people will not modify it, even though it is easy to do so
  • supported on almost all platforms LV is (have not tried to compile on RT yet)
Its disadvantages
  • very steep learning curve
  • need a DLL/shared library
  • not multi-thread safe on windows (by default, the option now exists)
  • poor LabVIEW support
HDF5 is actually designed as a complete data storage mechanism.  Using it on an INI file is often like swatting a fly with a sledge hammer.  However, I prefer to have the power when I need it, rather than having to rewrite my code and have backwards compatibility issues.

If you are interested, you can get more information at the HDF5 website.  NI makes a primitive API available here.  If you have LV8.2 or higher, it may be easier to create your own using the shared library wizard.  Others in the community are also working on APIs.

All things considered, however, the INI file is probably the easiest way to go.
0 Kudos
Message 3 of 3
(3,019 Views)