Modify a Custom Type

It is inevitable that you will want to modify a custom tag type that you have created. You might decide to change the parameters in the parent. Or, you might decide to add, edit or remove child tags. Or, perhaps you just want to change a few things about one instance. Each type of change has its own procedure.

If security is enabled, the privilege, "Manage Types", must be granted before you will be able to proceed. This privilege is not granted to any role by default.

Override a property of a single child tag instance.

If one instance of a custom type needs to have slightly different properties from all the rest, you will override that instance. For example, perhaps it's a characteristic of the primary pump that it is prone to overheat when running faster than 1000rpm, but the secondary pump doesn't have this problem. You might modify the speed I/O tag in the primary pump like so:

The orange color means that you are overriding default values.

All parameters in all child tags of a user-defined type are set automatically using whatever value was in that field when the type was created. You're allowed to override those values whenever and wherever you need. The orange color serves only as a reminder: "this value is an override, not a default".

In the Tag Browser, you'll get a similar warning:

The star on the orange dot indicates that this tag contains at least one parameter override.

If you were to add a new child tag in Pump 1, it would show with a green plus symbol:

"This child tag was added explicitly by a user"

If you delete a tag, then it's deleted. No symbol will show that it ever existed.

 

In all cases, these overrides affect only Pump 1. Nothing has yet changed Pump 2 or any other new CustomPump that you create. For that, you can...

Redefine a Type Definition

You can right-click on the parent tag of the structure, Pump 1, and from the menu choose Redefine Type. Instantly, all of the overrides within Pump 1 will be made part of the CustomPump definition. Pump 2 (and all subsequent pumps) will gain a warning alarm on the speed and a new demo tag.

There's a risk that the instance contains overrides that are meant only for that one object, not for all. Take extreme care when using this command.

When you decide to modify a user defined type definition, the recommended procedure is to:

  1. Create a temporary instance of that type. Call it Template or something equally obvious.
  2. Override the child tags as required. Add new tags, modify parameters, even delete (or better, disable) obsolete tags.
  3. Run Redefine Type on that temporary instance.
  4. Delete the temporary instance.

All the current pumps and all news ones will use the redefined type definition with one very important exception:

All existing tags keep their overrides.

Therefore, in the case of a conflict between a parameter that you change in the type definition and a parameter that you overrode in one particular pump, you always keep the local override.

Change the Parameter List

After turning a Context tag into a new type, the Settings tab becomes the Other Parameters tab. The ability to add and edit parameters has vanished. You can still work with the parameter list, but now you must use the Manage Types page in the Application Configuration dialog.

Manage Types

All of the user-defined types in the current application will be listed. You have two options:

  • Export and synchronize just the tags within the type. Use this to modify the child tags outside VTScada.
  • Edit the parameter list of the type definition.

Our focus here is the second of those two options. It's usually the easier method.

Select a type, then click the Edit button to open the Edit Properties page. Here you can work with the parameters of the type, just as you could in the original Context. In fact, this is slightly more powerful: you can use this page to delete the HelpKey parameter if you are not using it.

Detail from editing a type's properties

Work directly in the list to change properties. Use the Add button to create new properties. Note that you can provide only a name and label when doing so. There is no way to set a default value here for your parameter.

The Translate option refers to the value and means "This property is text".

 

Besides providing a way to edit the parameters, this is useful as a reminder for the names that you gave each parameter. After the Context has been turned into a type, only the label will show, making it difficult to build an expression that uses the parameter if you forgot the name.