Virus scan in progress. Please wait to download attachments.
This example demonstrates how to use an INI file to fill in values for a Combo Box.
The Config File VIs palette offers an encapsulated way to read and write to standard INI files. First we will generate a config file to use with these functions. This VI is an example of how this can be done. First it opens up the config file, converts the string array to a single string, writes the data to a specified key, and closes the file.
If you open up the INI file in notepad you see this information.
Now that we have a config file we will use it to populate the values of a Combo Box programmatically. To do this we open the config file, read the data at the correct location, parse the string into an array, write the array to the Strings property of the Combo Box, and set the value of the combo box to the first item in the array.
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
Download the attached ZIP file (or both of the VIs).
Open and run the "Create Config File.vi" (change values if you want)
Observe how the INI file was created in the folder that the VI executed from.
Open and run the "Populate Combo Box.vi"
Observe how the Combo Box is filled with the information from the INI file.
**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit thisdiscussion thread**
Will CLA, CLED, CTD, CPI LabVIEW Champion Choose Movement Consulting choose-mc.com
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.