02-29-2008 02:17 PM
02-29-2008 02:19 PM
02-29-2008 02:19 PM
Please see my Typedef Nugget to get you started.
Ben
02-29-2008 02:23 PM
02-29-2008 02:50 PM
03-01-2008 01:50 AM
03-01-2008 08:53 AM
Ton
I have never 'really' grasped the diff between strict type defs and typedefs. The first give me mainly headaches so I never use them.
Can someone enlighten me?
As I understand them and use them, Strict typedefs allow you to dictate the appearence as well as the data definitions.
They are useful if you want to make sure that every user interface that presents a cotrol or indicator all appear the same. An example would be a wizard interafce where you walk the user through completing a form. By use a strict typedef all FP instance will always look the same. The strctness does NOT apply to diagram constants, etc.
Ben
03-01-2008 05:13 PM
I found this (from LV Help) enlightening as to the differences between typedefs and strict typedefs:
Use type definitions and strict type definitions to link all the instances of a custom control or indicator to a saved custom control or indicator file. You can make changes to all instances of the custom control or indicator by editing only the saved custom control or indicator file, which is valuable if you use the same custom control or indicator in several VIs.
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 label, description, 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 for the new 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.
A strict type definition forces everything about an instance to be identical to the strict type definition, except the label, description, 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.
You cannot prevent an instance of a strict type definition from automatically updating unless you remove the link between the instance and the strict type definition.