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 ?
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.
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.
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?
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?
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.
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 INI__ogtk.vi->Banc Test Switchy.vi
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?