01-13-2009 05:02 PM
I have an application that has four instances of an xcontrol on the front panel. Each instance has different default values as saved in the toplevel VI.
The default values are present if I load the toplevel VI from memory, but I have not found a way to later do a global "reinitialize values to defaults" or do a "right-click...data operations...reinitialize to defaults" on any one of them. If I do this, nothing happens, they stay at whatever values they currenty have.
This problem can easily be demonstrated with the example "Run Dual Mode Thermometer xcontrol.vi" from the example finder: Change the value of the xcontrol (run mode or edit mode) and try to reset it back to defaults as described, nothing happens.
Is there any way to get this to work?
(Currently, I am writing the default values via local variables as needed but I would prefer if they would behave more similar to normal controls in this respect).
01-14-2009 05:46 AM
Hopefully Ton will reply latter but...
I thought I had to explicitly write all of the methods and properies myself, so if you did not write an "init to default" method...
I'll check back latter to learn something.
Ben
01-14-2009 06:08 AM
What default value do you exactly mean?
The Data State value OR the Internal State value?
I think the data value will be reset by the owning VI while the State data is in control by the XControl.
Tomorrow night I can do more testing.
Otherwise you will have to build your own context menu with option.
Maybe you can capture the event in the facade VI?
Ton
01-14-2009 11:07 AM - edited 01-14-2009 11:13 AM
TonP wrote:The Data State value OR the Internal State value?
I want to reset each instance to the values it had when I first opened the VI.
I did a few more tests, and it seems the problem is that the facade does not get updated, while the internal value actually changes back to the defaults.
The wire value is actually back to defaults (!!!), but an xcontrol indicator connected to that wire does not reflect the correct wire value until it gets "wiggled". This does not sound right!
.
I made an example that shows the weird behavior (LabVIEW 8.5.1).
The attached VI contains 3 temperature xcontrols (from the labview example)..
The FP contains instructions to reproduce the problem. (Of course all 6 instances of the xcontrol have the problem, not just #3).
(The xcontrol is located at: C:\Program Files\National Instruments\LabVIEW 8.5\examples\general\xcontrols\Dual Mode Thermometer )
01-14-2009 11:51 AM
Hi All,
This was reported to R&D (# 44114) for further investigation. A possible workaround is to create a button that will just reset the XControl back to the default value using a property node instead of right-clicking on the control. The invoke node of Reint to Default will not work.
01-14-2009 12:15 PM - edited 01-14-2009 12:18 PM
Joshua B. wrote:A possible workaround is to create a button that will just reset the XControl back to the default value using a property node instead of right-clicking on the control. The invoke node of Reint to Default will not work.
Thanks! Do you mean writing a value property?
From what I can tell, "reinit to defaults" and "default vals.Reinit all" both don't work.
01-14-2009 12:29 PM
01-14-2009 12:51 PM
01-14-2009 03:08 PM
Matthew Kelton wrote:
I dropped in a message box to the fascade VI, and the the fascade VI doesn't even run when you select reinit from the menu. I don't believe you have anyway currently to get it to work from the Menu. As Ben mentioned, you can write your own Method for reinit to default that you can at least use in the program.
And Matthew wrote:
Does that mean the APP_SC_REINIT_TO_DEFAULT_VALUE didnt trigger the facade VI?
What if you registered for the owning VI in the facade VI?
Ton
01-14-2009 05:02 PM