|MORECHEMISTRY.COM::MORE CHEMISTRY ON THE WEB|
LabVIEW programming topics - Using array sets in ini files
LabVIEW provides a convenient way to read single data elements from and to write single data elements to ini (config) files. However, for a series of similar data elements, e.g. an array, you should create some method of your own.
The presented method assumes you want to use the following type of data in your ini file:
In other words all data elements of an array are stored with a separate unique key.
These data elements may represent numerical values, booleans, or strings as in the following example:
Solution for reading the ini file
The general approach is simply to find the values for all consecutive given keys in a given section and store those value in an array as consecutive elements.
Solution for writing the ini file
The general approach is simply to write the consecutive elements of an array to the consecutive given keys in a given section.
This method requires a separate function for each data type. Fortunately LabVIEW offers a method to store all related funtions in a single library and a method to combine similar functions in a polymorphic function.
The sample program shows how to read/write values from an array of doubles and an array of Booleans.
Bart Boshuizen, 2011/03/02