An INI file is a configuration file that stores constants used in a program. The file consists of sections and keys. Keys are grouped in different sections. This recipe extracts the values from all keys within an INI file and stores them in a cluster so that the values can be retrieved within a program.
To read the values of all keys within an INI file, we create a state machine to iterate through the file, using following steps:
Create the INI file to read. See the following screenshot for the content within the INI file.
Create a state machine, as shown in the following screenshot. It starts in the Open INI state to open an INI file located in the same folder as the VI. After this state is completed, it transits to the Extract Values state.
Create the "Extract Values" state, as shown in the following screenshot. It loops through all sections and keys in the INI file. The value of each key is bundled into a cluster.