LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control, Typedef & Strict Typedef

Hi All

 

Can anyone give me a simple rule of thumb as to when to define a .ctl as a Control, Typedef or Strict Typedef?

 

I have come up with this, but am not sure if it is valid. Any articles on this would be of interest.

 

----->

 

Control setting is for instantiations which will be one-offs, and may be tailored in code. Such a .ctl is a rough start type.

 

Typedef setting is for instantiations that must remain type consistent with each other. Like messaging formats between applications.

 

Strict Typedef setting is for instantiations that must remain type and visually consistent with each other. Like application user-interface front-panels. However, note that a constant of a Strict-Typedef is treated like a Typedef, and only type information is updated.

 

----->

 

0 Kudos
Message 1 of 2
(7,041 Views)

Type Definitions

Type definitions identify the correct data type for each instance of a custom control or indicator. When the data type of a type definition changes, all instances of the type definition automatically update. In other words, the data type of the instances of the type definition change in each VI where the type definition is used. However, because type definitions identify only the data type, only the values that are part of the data type update. For example, on numeric controls, the data range is not part of the data type. Therefore, type definitions for numeric controls do not define the data range for the instances of the type definitions. Also, because the item names in ring controls do not define the data type, changes to ring control item names in a type definition do not change the item names in instances of the type definition. However, if you change the item names in the type definition for an enumerated type control, the instances update because the item names are part of the data type. An instance of a type definition can have its own unique caption, label, description, tip strip, default value, size, color, or style of control or indicator, such as a knob instead of a slide.

If you change the data type in a type definition, LabVIEW converts the old default value in instances of the type definition to the new data type, if possible. LabVIEW cannot preserve the instance default value if the data type changes to an incompatible type, such as replacing a numeric control or indicator with a string control or indicator. When the data type of a type definition changes to a data type incompatible with the previous type definition, LabVIEW sets the default value of instances to the default value you specify in the .ctl file. If you do not specify a default value, LabVIEW uses the default value for the data type. For example, if you change a type definition from a numeric to a string type, LabVIEW replaces any default values associated with the old numeric data type with empty strings.

Strict Type Definitions

A strict type definition forces everything about an instance to be identical to the strict type definition, except the caption, label, description, tip strip, and default value. As with type definitions, the data type of a strict type definition remains the same everywhere you use the strict type definition. Strict type definitions also define other values, such as range checking on numeric controls and the item names in ring controls. The only VI Server properties available for strict type definitions are those that affect the appearance of the control or indicator, such as Visible, Disabled, Key Focus, Blinking, Position, and Bounds.

Message 2 of 2
(7,028 Views)