Jump to content

Updating custom control after placement


Recommended Posts

I created a gage that is the right size but is the needle alone as a custom control as a solution to this thread:

http://forums.lavag.org/Custom-Gage-last-t...hope-t5663.html

I placed the custome control on my front panel.

Here's my question: If I change (edit) the custom control (color, size, etc) why doesn't the control change on my front panel? Is there any way to 'update' the control after it is placed (short of deleting it and re-placing it)?

Thanks.

Roy

Oops, meant to attach the custom control.

Download File:post-1161-1167801580.ctl

Link to comment
Here's my question: If I change (edit) the custom control (color, size, etc) why doesn't the control change on my front panel? Is there any way to 'update' the control after it is placed (short of deleting it and re-placing it)?

Make the control a typedef!:

post-2399-1167811719.png?width=400

Ton

Link to comment
Make the control a typedef!

From the LabVIEW Help:

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 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.

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.

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.

Creating and Editing Type Definitions and Strict Type Definitions

Use the Control Editor window to create and edit type definitions and strict type definitions. You use the same techniques to customize type definitions and strict type definitions that you use to customize other controls and indicators.

Preventing an Instance of a Type Definition from Automatically Updating

You can prevent an individual instance of a type definition from automatically updating when the data type of the type definition changes by right-clicking the instance and removing the checkmark next to the Auto-Update from Type Def. shortcut menu item. Removing the checkmark from the Auto-Update from Type Def. item prevents the instance from automatically updating when the data type of the type definition changes but preserves the link between the instance and the type definition. You can remove the link between an instance and a type definition by right-clicking the instance and selecting Disconnect from Type Def. from the shortcut menu.

Note 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.

If you disable automatic updating for an instance of a type definition and change the data type of the instance, the instance appears dimmed, and the Run button appears broken. To enable the instance, right-click the instance and select Update from Type Def. or Disconnect from Type Def. from the shortcut menu. Selecting Update from Type Def. changes the data type of the instance to the data type of the type definition. Disconnect from Type Def. permanently removes the link between the instance and the type definition.

When you change the data type of a type definition, all instances of that type definition that have automatic updating disabled appear dimmed when you open saved VIs containing the instances. Also, the Run button of the VI is broken. To enable the instance, right-click the instance and select Update from Type Def. or Disconnect from Type Def. from the shortcut menu.

Using Type Definitions and Strict Type Definitions

You place type definitions and strict type definitions on the front panel or block diagram the same way you place any custom control or indicator on the front panel or block diagram. When you right-click an instance of a type definition or a strict type definition on the front panel, the shortcut menu includes type definition options. You can open the type definition or strict type definition from the front panel by right-clicking the instance and selecting Open Type Def. from the shortcut menu. If you place an instance of a type definition or strict type definition on a block diagram, it appears as a constant, not as a front panel terminal. Changes you make to type definitions affect instances placed on block diagrams as constants in the same way the changes affect front panel instances.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.