12-03-2015 07:20 AM
In an xControl, when I change the Data.ctl typdef and apply changes, the instances are not updated & the VI's have the error "labview cannot update definition without incorrectly preserving default values".
On an ordinary VI, I would be able to right-click on the control and select "Review & Update from Type Def..." to resolve the error;
but it is not possible to right-click on the instances of the Data.ctl.
How do I resolve this issue with an xControl?
12-03-2015 09:13 AM - edited 12-03-2015 09:15 AM
Can you attach a simple example showing the issue?
If i had to guess, the following must be the case:
a) The data type of the xControl is no simple basic data type. Most likely a cluster.
b) You change the data type (data.ctl) to something incomptible (e.g. swapping a cluster data field to an incompatible data type or removing fields)
c) You have calling instances which define a default value (read: you did a right click on them and selected "Make current value default")
At least this is what i read from the error description. It means that default values cannot be updated as such that they match the new data type.
Solution would be to identify that defaulted instances before changing data.ctl and to re-create that controls to get rid of the default value.
Norbert
EDIT: Possibly you can capture the issue also with adding appropriate code to the Init ability. However, i don't know if a complete change of a data type can be addressed with this....
12-03-2015 10:33 AM
I am able to work around the problem by using scripting to force controls to update.
I mistakenly said that it was the Data.ctl, it is actually the State.ctl (which is a cluster) that causes trouble.
Sometimes the problem happens, and sometimes it doesn't.
The attached files show the problem.