LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting control to default value when it is a strict type def

Solved!
Go to solution

If my subVI has a control that happens to be a strict type defined cluster and I have saved the values in the control as the default values, how can I change them back to the default values of the type def (which are empty).  Because it is a strict type definition, i cannot click on the elements inside the cluster and modify them (e.g. click on an array inside the cluster and do an empty array operation.)

 

In the attached screenshot, the control "BLE Meters To Test" is just an array of clusters and I was able to empty the array.  The control "Capture Data" is a strict type def.  I would like to clear the contents of this control without having to delete the control and add it back with a new instance of the same strict type def.

 

 

 

0 Kudos
Message 1 of 5
(3,700 Views)

are you talking about edit mode or run mode?

 

You could temporarily add a second instance of the typedef (all empty), then change it to a constant. Whenver you need to reset at run time, write the new digram constant to a local variable of the control.

 


@glstill wrote:

Because it is a strict type definition, i cannot click on the elements inside the cluster and modify them (e.g. click on an array inside the cluster and do an empty array operation.)


Make sure to click on the array container, not on the array elements.

Message 2 of 5
(3,690 Views)

Thanks for the reply.  I was trying to change the control in edit mode.  I am running the VI analyzer on all of the code in the project and realized that this VI is nearly 3 MB on disk because of the default values stored in that control.  I was trying to see if there was an easy way to set it back that i wasn't aware of.

 

I think your suggestion will allow me to change the value of the control without having to delete the control and add it back to the connector pane.

 

Thanks,

Gary

 

 

0 Kudos
Message 3 of 5
(3,680 Views)

First off that doesn't really make sense (Unless that actually happens to be class private data) Each instance of a strict type def may have a unique Label, Caption, Discription, Tip-Strip and default value.  (This is also true for type defs however some cosemetics may also change)

 

When you sepecify a default Value in the type def or strict type def LabVIEW automatically assigns that value to each instance but this can be changed in any instance.

 

Now if you have an instance of a type def that contains other typedefs that have non-default default values you might get the behavior you are seeing at which point you need to change your type defs to have default default values and apply changes  

 

In this instance it might be easier to look at the controls vi heirarchy and look at the component controls to help you unwind this problem.

 

 


"Should be" isn't "Is" -Jay
Message 4 of 5
(3,671 Views)
Solution
Accepted by topic author glstill

Yes the clusters inside the strict type def cluster are also type defs and the control on this subVI is the only place where non-default values are in the clusters because they were saved as the default values for the control when I was doing developer testing on the VI.  All of the actual .ctl files have default default values in them.  

 

I just figured out that even though the objects inside the strict type def cannot be selected with the mouse, the right click operation still works and the values can be modified or cleared.  I don't think i need anymore help with this issue.

 

Thank you to everyone who responded.

Gary

0 Kudos
Message 5 of 5
(3,661 Views)