06-28-2011 04:34 AM - edited 06-28-2011 04:36 AM
Hi,
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 ?
Thanks,
06-28-2011 05:27 AM
Hi,
I guess that Read Panel from INI and Write Panel to INI from OpenG Toolkit are your friends.
Andrey.
06-28-2011 08:35 AM
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.
thanks,
06-28-2011 08:54 AM - edited 06-28-2011 08:57 AM
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.
06-30-2011 04:07 AM
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?
06-30-2011 08:32 AM
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?
06-30-2011 09:21 AM
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.
07-04-2011 03:40 AM
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
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?
07-04-2011 08:15 AM
any good idea to solve this problem? because this stuff is making me crazy
07-05-2011 08:52 AM
We cannot debug pictures (caveat: unless they are snippets). Please upload your code.