Showing results for 
Search instead for 
Did you mean: 

Labview configuration file



I have create a Vi that generate a configuration file for my application (see write configuration data and Read configuration data VIs) and it is working very well.

In "the write configuration data VI", data saved in the configuration file comes from controls of the font panel user interface.

in "the read configuration data VI", Values read from the configuration file are displayed in indicators of the front panel user interface.

And this is the problem because i want to integrate the "read configuration data VI" in an a global VI that use values of the configuration file as inputs (controls) and not indicators.

I guest I can use VI "Value property node" or "local variable" to read the value from the indicators but I am looking for a better way to use these indicators as controls. Any ideas ?



0 Kudos
Message 1 of 13



I guess that Read Panel from INI and Write Panel to INI from OpenG Toolkit are your friends.




Message 2 of 13

Can I have an example of how to use  Read Panel from INI and Write Panel to INI VIs? I don't know what to wire on refnum and Vi ref input. Actually I don't understand very well what a refnum is.



0 Kudos
Message 3 of 13

There's not a whole lot that you need to do. The refnum input is the refnum that is created from the Open Configuration File VI. The VI ref input is the reference to the VI for which you want to write the front panel control values to file. If you use the the Write Panel To INI VI in the same VI that you want to write to file, then you can just use the This VI reference constant.



Use the VI Package Manager to easily install the OpenG libraries.


As to your question about refnums, they're basically pointers to a location in memory where a data structure exists defining the object. For example, a file refnum points to a location in memory where there is a data structure containing the information about the file (like its path, etc). There are many different types of references, like control references.

Message 4 of 13

thanks you; writing a configuration file is now working but I've got some difficulties to read it.When I run the reading INI file VI, it runs without error message but controls in the front panel are not filled.


you said:

If you use the the Write Panel To INI VI in the same VI that you want to write to file, then you can just use the This VI reference constant


What about if I am not using them in the same VI?

0 Kudos
Message 5 of 13

I could'nt still read back the data I've saved in my configuration file.The INI file is created by the "write  panel to INI VI" all parameters have been saved.But now When i tried to read it with "read panel from INI", I do not have any errors but my controls in the front panel stays blank.Any suggestions to solve this problem?

0 Kudos
Message 6 of 13

That should work, although you do not need the error handler at the beginning, as it performs no useful function there. Have you verified that the .ini file is being created, and that the section name corresponds to the VI name? Your static VI reference point to "Untitled 2". I don't know what you used for the config file path, but there should be a section in there whose name matches the name of the VI. If you still cannot get it to work upload your VIs.

0 Kudos
Message 7 of 13

I solves the problem thanks to you, my section didn't have the same name that the VI .But now when I try to integrate it in my main program I get the following error message:


Error 91 occurred at Invoke Node in Read Panel from>Banc Test

Possible reason(s):
LabVIEW:  The data type of the variant is not compatible with the data type wired to the type input.
Method Name: Control Value:Set


The problem seems to come from the VI ref input, I tried both "This Vi reference"and "static VI reference" but I still get this error. does someaone has an idea to solve this issue?



0 Kudos
Message 8 of 13

any good idea to solve this problem? because this stuff is making me crazy

0 Kudos
Message 9 of 13

We cannot debug pictures (caveat: unless they are snippets). Please upload your code.

0 Kudos
Message 10 of 13