Function Tags

Not counted towards your tag license limit.

This is a legacy tag type. You are advised to use the I/O and Calculations Tag instead.
Use this legacy type only if you are certain that it contains unique features that are absolutely necessary to your work.

The Function tag type is used to perform mathematical and logical calculations using numeric values and, optionally, the values of other tags. A Function tag can accept up to four tag values or numeric values as properties, and the result of the calculation becomes the value of the Function tag. Other tags can use the value of a Function tag.

The output of a Function tag with no configured function parameters is undefined. It is not guaranteed to be any specific value, not even invalid.

Function tags are an older technology, maintained for backward-compatibility. You are advised to use Calculation tags for most applications.

Function properties Operator tab

The Operator tab identifies the operation that will be performed on the inputs for this tag.

OpCode

The OpCode drop-down list enables you to specify the type of operation to be performed on the values associated with this Function tag.

The parameters (values) that will be used for the selected operation, are configured on the tab, Inputs.

  • Parameters that are not configured have no impact on the resulting value of the function.
  • Parameters whose value evaluates to Invalid will cause most function operations to return Invalid.

The supported operations are:

+ All configured parameters are added. Any parameter that contains a tag or expression that evaluates to Invalid will result in the Function tag having the value, Invalid.
- Parameter 1 - Parameter 2 - Parameter 3 - Parameter 4 (disregarding any unconfigured parameters). Any parameter that contains a tag or expression that evaluates to Invalid will result in the Function tag having the value, Invalid.
* Parameter 1 * Parameter 2 * Parameter 3 * Parameter 4 (disregarding any unconfigured parameters). Any parameter that contains a tag or expression that evaluates to Invalid will result in the Function tag having the value, Invalid.
/ Parameter 1 / Parameter 2 / Parameter 3 / Parameter 4 (disregarding any unconfigured parameters). Any parameter that contains a tag or expression that evaluates to Invalid will result in the Function tag having the value, Invalid.
&

Logical AND. Three results are possible: TRUE, FALSE or Invalid.
* To return a value of TRUE, all configured parameters must evaluate to TRUE.
* If any configured parameter is FALSE, then the result will be FALSE.
* If no configured parameters evaluate to FALSE, but at least one evaluates to Invalid, then the result will be Invalid.

| Logical OR. Logical Three results are possible: TRUE, FALSE or Invalid.
* If any configured parameter is TRUE, then the result will be TRUE.
* If all configured parameters are FALSE, then the result will be FALSE.
* If no configured parameters evaluate to TRUE, but at least one evaluates to Invalid, then the result will be Invalid.
Average Average of Parameters 1 through 4 (excluding any undefined values).
Max Maximum of Parameters 1 through 4 (excluding any undefined values).
Min Minimum of Function Parameters 1 through 4 (excluding any undefined values).
Integrate Performs time integral of Parameter 1 * Parameter 2, every Parameter 3 seconds.
* If Parameter 2 is not defined, it defaults to a value of 1.
* If Parameter 3 is not defined, it defaults to a value of 1 second. For example, if Parameter 2 and Parameter 3 were not defined, the calculation would be Parameter 1 * 1 every 1 second).

Function properties Inputs tab

The Inputs tab identifies the numeric values or tag values that will be factors in the calculation.

Function Parameter X

The Function Parameter 1 through to Function Parameter 4 fields enable you to specify up to four factors in the calculation performed by this tag.

You may use a constant, expression or tag as the source of the value for each parameter. Parameters that are not configured are essentially ignored, in that they will not have an effect on the result of the calculation.

Parameters that are configured, but which evaluate to Invalid, will have an effect on the calculation as noted in the description of each operational code. Note that tags can have an invalid value when there is an error in communication. Many expressions can return a value of Invalid. For example, if attempting to divide by zero.

 You cannot select a Function tag as one of its own function parameters.

Function properties Manual tab

The Manual tab contains the Manual Data and Questionable Data properties. The Manual Data field can be used to enter a user-defined value for this tag that will override the value of its calculation. Use the Questionable Data check box to flag this tag’s data as being questionable in the event that you feel the values it is reporting might not be correct, or when this tag has initially been created and you wish to ensure that its data is monitored for validity.

Manual Data

Enables you to set a user-defined value for this tag, rather than reading the value from the associated I/O device (i.e. this user-defined value overrides the data incoming from the equipment).

If this field is anything other than a blank, or an invalid number, then the value from the I/O device is ignored and this value will be used instead.

The widget used by any tag with Manual Data will include an exclamation mark.

 If the value entered into the Manual Data field is a 0, the actual value reported by the equipment is also overridden, as 0 is considered a valid value. Therefore, if it is your intention to resume reading data from the I/O device, you must clear the Manual Data field entirely.

Questionable Data

Use this field to flag the tag’s data in the event that you suspect the values it is reporting might not be correct, or when this tag has initially been created and you wish to ensure that its data is marked for extra monitoring.

Function properties Owner tab

This tag can be used in an owner/contributor structure where multiple contributor tags can supply their values to an owner tag.

There is no specific "owner" tag type, rather an owner tag is typically a custom-designed tag that is created using VTScada scripting code.

Owner

Specify a tag to which this contributor should supply its data. An owner tag is one which you must design and then create, using the VTScada scripting language.

The owner tag may keep track of different aspects of each contributor's data, from the presence of a user-defined manual data value, to questionable data, according to the configuration of the check boxes appearing beneath the Owner field. These check boxes also determine the way that this contributor tag's value should be used in the owner tag's calculations.

Set Owner\DataX(…) to Value

When selected, the Set Owner\DataX[…] To Value check box is used to set the value of this contributor tag as the nth element in the owner tag's array. You may choose to set this contributor tag's value in more than one of the owner tag's array elements if required.

Set Active/Unack. Priority

An owner tag may keep track of the alarm priority and status of its contributors. When selected, the Set Active/Unack. Priority check box causes the owner tag to keep track of the priority of the contributor's active alarm (or records an Invalid if the contributor is not in an alarm state). Selecting the Set Active/Unack. Priority check box also causes the owner tag to record whether the alarm has been acknowledged.

Record Use of Manual Data

An owner tag may keep track of the number of contributor tags that are providing manual data (user-defined values), rather than reading data from their I/O device. When selected, the Record Use of Manual Data check box is used to increment the owner's count of the number of tags that are contributing manual data by 1 when manual data has been provided for this contributor, and decrement this count by 1 when no manual data value has been specified.

Record Data Quality (Analog and Digital Input only)

An owner tag may keep track of the quality of the data for each of its contributors. When selected, the Record Tag Quality check box is used to increment the owner tag's count of the number of tags that are contributing quality data by 1, and decrement this count by 1 when this contributor is not supplying quality data.

Record Tag Validity

An owner tag may keep track of the questionable status of the data for each of its contributors. When selected, the Record Tag Validity check box is used to increment the owner tag's count of the number of tags that are contributing questionable data by 1, and decrement this count by 1 when this contributor is not supplying questionable data.

Function properties Alarm tab

If you want this tag to trigger an alarm, use the Add button to open a configuration panel for a new Alarm tag. The triggered-by field for the new alarm will automatically be linked to this tag’s value. The new alarm tags will be created as children of the current tag.

Function properties Script tab

Optionally, link one or more Script tags to this tag. A Script tag provides a means of creating a procedure, using VTScada’s programming language, that will run whenever this tag’s value changes.

Function properties Logger tab

The logger tab enables you to associate a single Logger tag with this tag. The Logger tag works with an Historian to this tag’s data to disk so that it can be plotted on the Historical Data Viewer page. The new logger tag will be created as a child of the current tag.