Advanced Tags Manual
Advanced Tags Manual
Table of Contents
Table of Contents 2
Advanced Tags Help 4
Overview 4
Plug-In Interface 4
www. kepware.com
Advanced Tags Help 3
Error importing CSV tag <tag name>. Maximum value <max value> is out of range. Maximum value
has been set to <max value>. 31
Error importing CSV tag <tag name>. Run by <value> is invalid. Run by set to 'Rate'. 31
Error importing CSV tag <tag name>. Run by rate <value><units> is out of range. Run by rate has
been set to <value><units>. 31
Error importing CSV tag <tag name>. Link mode <link mode> is invalid. Link mode set to On Data
Change of Input Tag. 31
Error importing CSV tag <tag name>. Trigger scan rate <value> <units> is out of range. Trigger
scan rate has been set to <value> <units>. 32
Error importing CSV tag <tag name>. Link mode <link mode> is invalid. Link mode set to On Data
Change of Input Tag. 32
Error importing CSV tag <tag name>. Trigger type <trigger type> is invalid. Trigger type set to
Always. 32
Error importing CSV tag <tag name>. Update by <update rate> is invalid. Update by set to <update
rate>. 32
Error importing CSV tag <tag name>. Link rate <value> <units> is out of range. Link rate has been
set to <value> <units>. 33
Error importing CSV tag <tag name>. Update rate <value><units> is out of range. Update rate has
been set to <value><units>. 33
Error importing CSV tag data. No advanced tag records found in CSV file. 33
Derived Expression Messages 33
", expected. 34
( expected. 34
) expected. 34
Expression modified. 34
Numeric expression expected. 35
Please enter an expression. 35
String tag expected. 35
Syntax error: <syntax string>. 35
Unknown tag or misspelled keyword: <tag name>. 35
Unrepresentable numeric constant: <tag name>. 36
Unterminated string. 36
Index 37
www. kepware.com
4 Advanced Tags Help
CONTENTS
Overview
What are Advanced Tags?
Error Descriptions
What error messages do Advanced Tags produce?
Overview
Advanced Tags are used to perform basic analytics such as math, logic and evaluation functions on other tags.
There are currently seven types of Advanced Tags: Average, Complex, Derived, Link, Minimum, Maximum and
Oracle Cumulative.
Plug-In Interface
The Advanced Tags Plug-In interface consists of a Project View and Detail View, located on the left and right
panes of the user interface respectively. The toolbar is located above both views, and contains all of the options
available to the Advanced Tags objects. Users may also access these options by clicking Edit | Advanced Tags.
Note: Drag and drop can be used to move objects. To copy objects, press and hold the Control key during drag
and drop.
Project View
The Project View displays the Advanced Tags hierarchy, which consists of a root _AdvancedTags node and
Advanced Tag groups. _AdvancedTags is the root node for the Advanced Tags hierarchy, to which Advanced
Tags and/or groups can be added. Advanced Tag groups are used for organization, and may contain Advanced
Tags and/or other groups.
Note: In the image above, the Advanced Tag Group is labeled "Group1."
Detail View
The Detail View displays the Advanced Tags under the node currently selected in the Project View. Users can
create, edit, enable, disable, copy, cut, paste, delete and drag and drop tags to nodes in the Project View.
Toolbar
The Toolbar provides convenient access to all of the Advanced Tag functions (such as adding objects, editing
objects, enabling, disabling objects, cutting, copying, pasting and undoing events).
www. kepware.com
Advanced Tags Help 5
l Name: This parameter specifies the name of the tag group. The name cannot start with an underscore
and must be unique among sibling tag groups. It may be up to 512 characters in length.
l Tags assigned to this group: This informational text reports the number of tags assigned to the
current tag group.
l Tags assigned to this branch: This informational text reports the number of tags assigned to the
current tag group and all descendant tag groups.
l Enabled: This parameter specifies the state of the tag group. If a tag group is disabled, all descendant
tags and tag groups are also disabled.
CSV Import/Export
The Advanced Tags Plug-In supports the import and export of tag data in a Comma Separated Variable (CSV) file.
When using CSV import and export, tags are created quickly in the desired application. CSV functions are only
available when an Advanced Tag Group is selected. Furthermore, parameters that are not defined in the CSV file
are assigned appropriate default values.
Notes:
l For information on specifying which character to use as the variable (comma or semicolon), refer to
"Options - General" in the server help file.
l CSV files generated with an earlier version of the Advanced Tags Plug-In may contain property names and
values that differ from the current version format. Although these files import without problems, it is
recommended that editing for CSV import occurs using the latest CSV export format.
Creating a Template
The easiest way to create an import CSV file is to create a template. For more information, refer to the instructions
below.
1. To start, create an Advanced Tag Group. Then, define an Advanced Tag of each type to be used in the
project.
3. Use this template in a spreadsheet application that supports CSV files, and then modify the file as desired.
Note: Users can save the CSV file to disk, and then re-import it into the server beneath the same tag
group or a new tag group.
www. kepware.com
6 Advanced Tags Help
Note: Microsoft Excel is an excellent tool for editing large groups of tags outside the server. Once a template CSV
file has been exported, it can be loaded directly into Excel for editing. A CSV file load in Excel would appear as
shown below.
Example CSV
Exporting an Advanced Tag Group list generates a .CSV text file that contains a section for each Advanced Tag
type, in addition to a section for Complex Tag elements. Each section contains a heading record followed by a
record for each tag defined under the selected tag group. The heading records contain the following column
names: AverageTag, OracleCumulativeTag, ComplexTag, DerivedTag, LinkTag, MaximumTag, MinimumTag, and
ComplexTagElement. Column names must be exactly the same as those listed; however, columns may be in any
order and all columns (except for "Name," "Tag Name," and "Complex Tag Reference") are optional.
Important: The Advanced Tag type sections may be in any order, with the exception of the Complex Tag
Elements section. That section must be placed after the Complex Tags section. A Complex Tag Element must
reference the Complex Tag to which it belongs. If the parent Complex Tag is not added during import (due to
omission from the CSV file or another error), the Complex Tag Element is not added.
AverageTag Fields
Column Name Values
Record Type "Average Tag"
Name The tag name (with path relative to the tag group being imported/exported).
Description The tag description (which may be up to 64 characters).
Enabled 1 to enable, and 0 to disable.
Source The tag from the server for which an average is calculated.
Data Type The Average Tag's data type.
Run Tag The tag to be monitored to determine if it is appropriate to calculate the
average value of the Average Tag.
OracleCumulativeTag Fields
Column Name Values
Record Type "Oracle Cumulative Tag"
Name The tag name (with path relative to the tag group being imported/exported).
Description The tag description (which may be up to 64 characters).
Enabled 1 to enable, and 0 to disable.
Source The tag from the server for which the cumulative value is calculated.
Data Type The Oracle Cumulative Tag's data type.
Maximum Value The maximum value of the tag being used.
ComplexTag Fields
Column Name Values
Record Type "Complex Tag"
Name The tag name (with path relative to the tag group being imported/exported).
Description The tag description (which may be up to 64 characters).
Enabled 1 to enable, and 0 to disable.
Update By Options include Rate or Trigger.
Rate The value for the update rate.
Rate Units Options include milliseconds, seconds, minutes, hours, or days.
Trigger Tag The tag from the server that triggers the Complex Tag update.
Complete Tag The tag from the server that is set once a Complex Tag update has been sent
to all subscribing clients.
DerivedTag Fields
Column Name Values
Record Type "Derived Tag"
Name The tag name (with path relative to the tag group being imported/exported).
Description The tag description (which may be up to 64 characters).
Enabled 1 to enable, and 0 to disable.
Data Type The Derived Tag's data type.
www. kepware.com
Advanced Tags Help 7
LinkTag Fields
Column Name Values
Record Type "Link Tag"
Name The tag name (with path relative to the tag group being imported/exported).
Description The tag description (which may be up to 64 characters).
Enabled 1 to enable, and 0 to disable.
Input Tag The server tag used as the source of the link.
Output Tag The server tag used as the destination of the link.
Dead Value The value written to the Output if the Input is of bad quality.
Link Mode Options include On Data Change of Input Tag, On Data Change of Input Tag
(Ignore Initial Update), and On Interval.
Link Rate The link rate is in milliseconds.
Trigger Tag The tag value compared to the Value parameter using the Comparison
parameter.
Comparison Options include the following:
MaximumTag Fields
Column Name Values
Record Type "Maximum Tag"
Name The tag name (with path relative to the tag group being imported/exported).
Description The tag description (which may be up to 64 characters).
Enabled 1 to enable, and 0 to disable.
Input Tag The tag from the server for which a maximum value is calculated.
Data Type The Maximum Tag's data type.
Run Tag The tag to be monitored to determine if it is appropriate to calculate the
maximum value of the Maximum Tag.
MinimumTag Fields
Column Name Values
Record Type "Minimum Tag"
Name The tag name (with path relative to the tag group being imported/exported).
Description The tag description (which may be up to 64 characters).
Enabled 1 to enable, and 0 to disable.
Input Tag The tag from the server for which a minimum value is calculated.
Data Type The Minimum Tag's data type.
Run Tag The tag to be monitored to determine if it is appropriate to calculate the
minimum value of the Minimum Tag.
www. kepware.com
8 Advanced Tags Help
ComplexTagElement Fields
Column Name Values
Complex Tag Reference The Complex Tag to which the element belongs.
Tag Name The server tag that is inserted into the Complex Tag.
Insert By Options include Rate or Trigger.
Rate The value for the update rate.
Rate Units Options include milliseconds, seconds, minutes, hours, or days.
Trigger Tag The tag from the server that triggers the element insertion.
Complete Tag The tag from the server that is set once the element insertion is complete.
Note: This option is only available when an Advanced Tag Group is selected.
1. Save the project in XML. Then, perform mass configuration on the XML file instead of using CSV.
2. Perform a search-and-replace on the delimiter in the CSV file and then replace the delimiter with a comma
or semicolon. The delimiter being used by the server (either comma or semi-colon) must be set to the
replacement character.
Note: For more information, refer to "Options - General" in the server help file.
www. kepware.com
Advanced Tags Help 9
Average Tags
Complex Tags
Derived Tags
Link Tags
Maximum Tags
Minimum Tags
Oracle Cumulative Tags
Identification
All Advanced Tags' property dialogs include an Identification section that contains parameters available to all
Advanced Tags. Users may create multiple Advanced Tags by utilizing the options displayed in this section.
l Tag Type: This parameter specifies the tag type. When creating a new tag, users set this value to the
desired tag type through the drop-down menu. When editing an existing tag, this parameter displays the
tag type of the tag being edited and cannot be changed.
l Name: This parameter specifies the name of the tag. The name can be up to 256 characters in length and
cannot contain periods, double quotes or start with an underscore.
l Show Tag List: When clicked, this button displays the Tags dialog used to select a tag under the
currently selected node in the Project View. If the selected node has no tags, this parameter is disabled.
For more information, refer to Tag List.
Tag List
The Tags list displays all the tags under the currently selected tag group and is used to select a tag for editing.
www. kepware.com
10 Advanced Tags Help
Average Tags
When enabled, Average Tags calculate an average of a tag's value over time. Averaging is initiated by the value of
a Run Tag transitioning from zero to non-zero. The rate that the Average Tag is updated from the server with a
new value comes from the update/scan rate assigned to the tag to be averaged. The default scan rate is 100
milliseconds.
l Average: This parameter specifies the tag from the server for which an average is calculated.
l Data Type: This parameter specifies the data type of the Average Tag.
Note: Although Double is the only data type available in the Tag Properties, users can request a different
data type in the OPC Client. The server takes ownership for coercing the data.
l Run: This parameter specifies the tag to be monitored to determine if it is appropriate to calculate the
average value of the Average Tag. If the Run Tag's value is zero when the Average Tag is first requested
by a client application, the Average Tag has no value. Whenever the Run Tag's value transitions from zero
to a non-zero value, the Average Tag begins calculating a new average. The frequency of the calculation is
based on the scan rate of the Average Tag, so intermediate average values are reported to client
www. kepware.com
Advanced Tags Help 11
applications. When the Run Tag's value transitions back to zero, the last average value is maintained and
reported to the client applications.
Example
A tag that measures the temperature at a location (with a scan rate of 60000 milliseconds) would update the
Average Tag with the following values every minute:
72.3 @ 10:00
72.5 @ 10:01
72.9 @ 10:02
73.4 @ 10:03
72.4 @ 10:04
71.6 @ 10:05
71.2 @ 10:06
70.5 @ 10:07
If the Trigger Tag successfully transitioned from zero to one, the Average Tag would show the following values:
72.3 @ 10:00
72.4 @ 10:01
72.6 @ 10:02
72.8 @ 10:03
72.7 @ 10:04
72.6 @ 10:05
72.3 @ 10:06
72.1 @ 10:07
Note: If the quality of the Run Tag or the tag being averaged is bad, the quality of the Average Tag is also bad
and averaging stops. To restart, both tags must return to good quality.
Complex Tags
When enabled, Complex Tags group multiple tags of varying data types as a single complex item or structure.
When disabled, they do no work and have a string value of <ComplexUpdate></ComplexUpdate>. Although they
are primarily used with Oracle MOC connections, any client can read the tags. The tags return data as an XML
string defined by the schema below.
www. kepware.com
12 Advanced Tags Help
Note: The updates grouped in a complex update are not atomic, but are aggregated over a time interval. As a
result, clients cannot assume that all updates in a complex update occurred at the same time. To get the time of
the update, use the item's time stamp element.
l Elements: This parameter lists tags that are part of the Complex Tag.
www. kepware.com
Advanced Tags Help 13
l Add Element: When clicked, this button launches the Complex Element Property, which is then used to
select tags for the Element list.
l Modify Element: When clicked, this button launches the Complex Element Property, which is then used
to Modify elements that are highlighted in the Element list.
l Delete Element: When clicked, this button deletes elements that are highlighted in the Element list.
l Send complex tag updates by: This parameter specifies whether complex tag updates are sent by Rate
or Trigger. The default setting is Rate. Descriptions are as follows:
l Rate: When selected, this parameter dictates the rate at which the Complex Tag updates are
published. The default setting is 1 second.
Note: The range depends on the unit. The range for milliseconds is 10 to 999,999,999. The
range for seconds is 1 to 4294967. The range for minutes is 1 to 71582. The range for hours is
1 to 1193. The range for days is 1 to 49. The default unit is seconds.
l Trigger: When selected, this parameter dictates the condition at which Complex Tag updates are
published. There are two types: Trigger and Complete. The Trigger Tag's value is monitored
for a zero to non-zero transition. When this transition occurs, it results in a Complex Tag update.
No additional updates occur until the tag's value is reset to zero and another zero to non-zero
transition occurs. When a Complete Tag is provided, the server writes a value of 1 to the
Complete Tag (to notify that the update has been completed) once a Complex Tag update has
been sent to all subscribing clients. Users can tie this to logic in a controller or other subsystem
to indicate that the next complex value is ready to be formulated.
Note: Array tags cannot be used as Trigger or Complete tags. Complete tags must have
writeable access.
Complex Element
The Complex Element dialog is used to browse for an element and then insert it into complex tag. The element
data may be inserted by Rate or Trigger. For descriptions of these options, refer to the parameter descriptions
above.
Derived Tags
Derived Tags are used to provide math and/or logic operations on the value or quality of one or more tags. These
functions can be combined to perform complex math routines and evaluations. When enabled, the expression is
evaluated. When disabled, the expression is not evaluated and the OPC DA quality of the tag is “Bad - Out of
Service.”
Notes:
1. The execution of the string follows standard arithmetic rules. For more information, refer to Expression
Strings.
www. kepware.com
14 Advanced Tags Help
l Data Type: This parameter specifies the data type of the result of the expression execution.
Note: If a Derived Tag has a data type of String, the maximum length of the tag's String value is 4096.
This limit includes characters in an expression (such as "abc"). Any characters that exceed this limit are
truncated.
l Expression: This parameter specifies the expression to be executed by the tag.
l Tag Browser: When clicked, this button launches the Tag Browser (from which users may locate tags).
l Check Expressions: When clicked, this button checks the validity of the selected expression.
l Run expression by: This parameter specifies whether the expression is run by Rate or Trigger. The
default setting is Rate. Descriptions are as follows:
l Rate: When selected, this parameter dictates the rate at which the expression is evaluated/run.
The default setting is 1 second.
Note: The range depends on the unit. The range for milliseconds is 10 to 999,999,999. The
range for seconds is 1 to 4294967. The range for minutes is 1 to 71582. The range for hours is
1 to 1193. The range for days is 1 to 49. The default unit is seconds.
l Trigger: When selected, this parameter dictates the condition at which the expression is
evaluated/run. There are two types: Trigger and Complete. The tag defined in the Trigger field
is monitored for a zero to non-zero transition. When this transition occurs, the expression is
evaluated/run. No additional updates occur until the tag's value is reset to zero and another zero
www. kepware.com
Advanced Tags Help 15
to non-zero transition occurs. When a Complete Tag is provided, the server writes a value of
VARIANT TRUE to the tag defined in the Complete field when the expression is evaluated/run.
Users can tie this to logic in a controller or other subsystem to indicate that the evaluation of the
expression is complete.
Note: If the tag has a Boolean data type, it indicates TRUE. For other data types, the VARIANT_
TRUE value is converted, resulting in -1 for signed data types or “max. value for type” for
unsigned data types.
Expression Strings
Expression strings are used to specify the math formula that is being defined. Expressions are validated for
correct syntax and valid format. Array tags cannot be used in an expression.
Note: When referencing the value of a tag in the Expression string, the fully qualified item name is preceded by
the keyword TAG and enclosed in parentheses. When referencing the quality of a tag in the Expression string,
the fully qualified item name is preceded by the keyword QUALITY and enclosed in parentheses.
Example 1:
TAG(Channel1.Device1.Tag1)
Example 2:
QUALITY(Channel1.Device1.Tag1)
Note: Comments are also supported in Expression strings. Anything after a pound sign (#) is ignored.
Example 3:
TAG(x) + TAG(y) # Add tag x and tag y
Example 4:
QUALITY(x) AND QUALITY(y) # Examine the quality of tag x and tag y
Note: For more information specific to Derived Tags, refer to Arithmetic Operators, Functions, and Logic.
Link Tags
Link Tags are used to link two server tags. For example, this allows Tag A from Device A to be linked to Tag B from
Device B without requiring a third-party client connection. When enabled, a Link Tag writes the value of an Input
Tag to an Output Tag, effectively linking the two tags. The Link tag has the string value of <input tag> !=
<output tag> until the first link occurs, then the string becomes <input tag> == <output tag>. When disabled,
a Link Tag does no linking and the OPC DA quality of the tag is “Bad - Out of Service.”
www. kepware.com
16 Advanced Tags Help
l Input: This parameter specifies the Input Tag, which must be a valid server tag. It is used as the source
of the link, and its value is written to the Output Tag.
Note: The Input and Output fields cannot be the same.
l Output: This parameter specifies the Output Tag, which must be a valid server tag. It is used as the
destination of the link and is written to using the value of the Input Tag. The Output Tag must be writable.
Note: The Input and Output fields cannot be the same.
l Dead Value: This parameter specifies the value written to the Output if the Input is of bad quality. This
value's data type is the data type of the Output. Users must choose dead values that are within the range
of the Output tag's data type to ensure that no data is lost. If the field is left empty, the dead value is
disabled. If disabled, the Output's value and quality does not change when the Input is bad quality.
Note: If the Output is an array tag, each array element is set equal to the Dead Value.
l Trigger Type: This parameter specifies when the configured link is active. The options are: Always,
While Trigger Comparison True, and On Trigger Comparison True. The default selection is Always.
Descriptions of the options are as follows:
l Always: The configured link is active as long as the server is running and the Link Tag is
enabled.
l While Trigger Comparison True: The configured link is active when the server is running, the
Link Tag is enabled, and the configured trigger comparison evaluates to true. While the logic
defined for the trigger in the Comparison and Value fields is satisfied, linking occurs based on
www. kepware.com
Advanced Tags Help 17
the configured Link Mode (i.e. On Data Change of Input Tag or On Interval). When the trigger
comparison evaluates to false, no linking occurs.
l On Trigger Comparison True: If the server is running and the Link Tag is enabled, then the
input is linked to the output when the logic defined for the trigger in the Comparison and Value
fields is satisfied. At that moment, the Input Tag is read and the Output Tag is updated. No link
occurs until a change in the trigger value occurs and satisfies the configured trigger logic.
l Trigger Tag: This parameter specifies a tag whose value is compared to the Value parameter using the
Comparison parameter (such as Trigger Tag == Value). This parameter is only available to configure
when the Trigger Type is While Trigger Comparison True or On Trigger Comparison True.
Notes: The specified tag must be a valid server tag and cannot be an array tag. The Trigger and Output
Tags cannot be the same.
Description of the trigger behavior for each of the Trigger Type is as follows:
l While Trigger Comparison True: While the Trigger Tag value satisfies the Comparison and
Value configuration, the input is linked to the output based on the Link Mode configuration. No
link occurs when the trigger comparison is not met.
l On Trigger Comparison True: The Trigger Tag is scanned at the configured Trigger Scan
Rate. Each time a change in the Trigger Tag value that satisfies the Comparison and Value
configuration is detected, a read of the Input Tag occurs and the Output Tag is updated. No link
occurs until a change in the trigger value occurs and satisfies the configured trigger logic.
l Trigger Scan Rate: This parameter specifies the scan rate of the Trigger Tag. The valid range is 50 –
1800000000 milliseconds. The default setting is 1000.
l Comparison: This parameter specifies the logical comparison between the Trigger Tag value and the
Value parameter. Descriptions of the options are as follows:
l Trigger Tag > Value: The trigger tag value is greater than the value.
l Trigger Tag >= Value: The trigger tag value is greater than or equal to the value.
l Trigger Tag < Value: The trigger tag value is less than the value.
l Trigger Tag <= Value: The trigger tag value is less than or equal to the value.
l Trigger Tag == Value: The trigger tag value is equal to the value.
l Trigger Tag != Value: The trigger tag value is not equal to the value.
l Value: This parameter specifies the Value to compare to the value of the Trigger Tag. The data type of
this value is equal to the data type of the Trigger Tag.
l Link Mode: This parameter specifies the required conditions to initiate the link. The default selection is
On Data Change of Input Tag. Descriptions of the options are as follows:
l On Data Change of Input Tag: The input is linked to the output any time the input is good
quality and its value changes.
Tip: When the link mode is On Trigger Comparison True, a true trigger tag input change also
causes a link.
l On Data Change of Input Tag (Ignore Initial Update): The input is linked to the output
anytime that the input value changes, except for the initial update (which is ignored and does not
count as an input value change). The Link Tag has the string value <input tag> != <output tag>
until after the first update successfully completes. At that time, subsequent updates have the
string value <input tag> == <output tag>.
Note: An initial update of bad quality is not considered an initial update.
l On Interval: The input is linked to the output every Link Rate (milliseconds).
l Link Rate (ms): The frequency of update as defined in this parameter depends on the chosen Link
Mode. The valid range is 50 – 1800000000 milliseconds. The default setting is 1000. Description of the
Link Rate for each of the Link Mode options is as follows:
l On Data Change of Input Tag: The configured Link Rate defines the scan rate of the Input Tag.
This is the fastest rate at which a change in the Input value may be detected.
l On Interval: The Link Rate defines the rate at which to update the output. Each time the interval
elapses, the Input Tag is read and the Output Tag is updated.
Note: A link for the On Interval Link Mode requires a read of the Input Tag and a write to the
Output Tag. These operations are given priority. If the linking is occurring at a fast rate (such as
50 milliseconds) it is possible that other clients operating in exception-based mode could miss
data updates. Make sure that linking is occurring no faster than is required.
www. kepware.com
18 Advanced Tags Help
Array Tags
Link Tags can be used to link array tags, provided the following:
It is best to use arrays with the same dimensions. For more information, refer to the table of examples below.
Note: The examples above use address syntax from the Simulator Driver and do not include the channel and
device names.
www. kepware.com
Advanced Tags Help 19
Maximum Tags
When enabled, Maximum Tags calculate the maximum value of a tag's value. Determining the maximum value is
initiated by the value of a Run Tag transitioning from zero to non-zero. The rate that the tag is updated from the
server with a new value comes from the update/scan rate on the device tag in the server. The default scan rate is
100 milliseconds. Maximum Tags report OPC DA quality of “Bad - Out of Service” when disabled.
l Maximum: This parameter specifies the tag from the server for which a maximum value is calculated.
l Data Type: This parameter specifies the data type of the Maximum Tag.
Note: Although Double is the only data type available in the Tag Properties, users can request a different
data type in the OPC Client. The server takes ownership for coercing the data.
l Run: The Run Tag is monitored to determine if it is appropriate to calculate the maximum value of the
Maximum Tag. Whenever the Run Tag's value transitions from a zero to a non-zero value, a new maximum
value is calculated for the Maximum Tag. The calculation determines whether or not the currently
scanned maximum value is higher than the reported maximum value. If it is, it replaces the reported value
with the scanned value. When the Run Tag's value transitions back to zero, the last maximum value is
maintained and reported to the client application.
Examples
A tag that measures the temperature at a location (with a scan rate of 60000 milliseconds) would update the
Maximum Tag with the following values every minute:
72.3 @ 10:00
72.5 @ 10:01
72.9 @ 10:02
73.4 @ 10:03
72.4 @ 10:04
71.6 @ 10:05
71.2 @ 10:06
70.5 @ 10:07
If the Trigger Tag had successfully transitioned from 0 to 1, the Maximum tag would show the following values:
72.3 @ 10:00
72.5 @ 10:01
www. kepware.com
20 Advanced Tags Help
72.9 @ 10:02
73.4 @ 10:03
73.4 @ 10:04
73.4 @ 10:05
73.4 @ 10:06
73.4 @ 10:07
Note 1: If the quality of the Maximum Tag or the Trigger Tag is bad, the quality of the Maximum Tag is also bad.
Note 2: If the quality of the Minimum Tag or the Trigger Tag is bad, calculation of the minimum value stops. For
calculation of the minimum value to restart, both tags must return to good quality and the Trigger Tag must
successfully transition from zero to non-zero.
Minimum Tags
When enabled, Minimum Tags calculate the minimum value of a tag's value. Determining the Minimum value is
initiated by the value of a Run tag transitioning from zero to non-zero. The rate that the tag is updated from the
server with a new value comes from the update/scan rate on the device tag in the server. The default scan rate is
100 milliseconds. Minimum Tags report OPC DA quality of “Bad - Out of Service” when disabled.
l Minimum: This parameter specifies the tag from the server for which a minimum value is calculated.
l Data Type: This parameter specifies the data type of the Minimum Tag.
Note: Although Double is the only data type available in the Tag Properties, users can request a different
data type in the OPC Client. The server takes ownership for coercing the data.
l Run: The Run Tag is monitored to determine if it is appropriate to calculate the minimum value of the
Minimum Tag. Whenever the Run Tag's value transitions from a zero to a non-zero value, a new minimum
value is calculated for the Minimum Tag. The calculation determines whether or not the currently scanned
minimum value is lower than the reported minimum value. If it is, it replaces the reported value with the
scanned value. When the Run Tag's value transitions back to zero, the last minimum value is maintained
and reported to the client application.
Examples
A tag that measures the temperature at a location (with a scan rate of 60000 milliseconds) would update the
Minimum Tag with the following values every minute:
www. kepware.com
Advanced Tags Help 21
72.3 @ 10:00
72.5 @ 10:01
72.9 @ 10:02
73.4 @ 10:03
72.4 @ 10:04
71.6 @ 10:05
71.2 @ 10:06
70.5 @ 10:07
If the Trigger Tag had successfully transitioned from 0 to 1, the Minimum Tag would show the following values:
72.3 @ 10:00
72.3 @ 10:01
72.3 @ 10:02
72.3 @ 10:03
72.3 @ 10:04
71.6 @ 10:05
71.2 @ 10:06
70.5 @ 10:07
Note 1: If the quality of the Minimum Tag or the Trigger Tag is bad, the quality of the Minimum Tag is also bad.
Note 2: If the quality of the Minimum Tag or the Trigger Tag is bad, calculation of the minimum value stops. For
calculation of the minimum to restart, both tags must return to good quality and the Trigger Tag must
successfully transition from zero to non-zero.
Oracle Cumulative
Oracle Cumulative Tags are specifically designed for Oracle requirements. When enabled, they return the delta
between the last value polled and the current value polled from a specific tag. This tag type reports an OPC DA
quality of “Bad – out of service” when disabled.
On the first update, the raw value is be sent to the client. Each successive value takes the cumulative value and
sends it to the client. Values that cannot be read and that are considered bad quality are skipped and the next
good value used. To account for rollover, enter the maximum raw value that can be read to calculate the
cumulative value appropriately.
www. kepware.com
22 Advanced Tags Help
l Cumulative: This parameter specifies the tag from the server for which the cumulative value is
calculated.
l Data Type: This parameter specifies the data type of the result, which is the value of this tag.
l Maximum Value: The Maximum Value should be set to equal the maximum value of the tag being used.
For example, if the tag is a counter with a max value of 1000, the Cumulative Tag Maximum Value property
should be set to 1000.
Examples
Assume that in calculating the cumulative value for a counter that ranges from 0-100 (set the maximum value to
100), the following samples were read:
5 @ 10:00
45 @ 10:01
95 @ 10:02
4 @ 10:03
Arithmetic Operators
Arithmetic Operators perform a math process. The result of that process is returned as the value of the Derived
tag.
Examples
Arithmetic Formula Result
Function
Add Tag TAG(Sim.Device.Add1)+TAG If Add1=6 and Add2=71, the result is 77.
(Sim.Device.Add2)
Add Quality QUALITY(Sim.Device.Add1)+QUALITY If both the Add1 and the Add2 tags have good
(Sim.Device.Add2) quality, the result is 2.
If neither tag has good quality, the result is 0.
If only one of the tags has good quality, the
result is 1.
Subtract TAG(Sim.Device.Subtract1)-TAG If Subtract1 is 5 and Subtract2 is 10, the result
(Sim.Device.Subtract2) is -5.
Multiply TAG(Sim.Device.Multiply1)*TAG If Multiply1=3 and Multiply2=4, the result is
(Sim.Device.Multiply2) 12.
Divide TAG(Sim.Device.Divide1)/TAG If Divide1=5 and Divide2=2, the result is 2.5.
(Sim.Device.Divide2)
www. kepware.com
Advanced Tags Help 23
(TAG(Sim.Device.Polynomial-Coefficient1)*(TAG(Sim.Device.Polynomial-X)*TAG
(Sim.Device.Polynomial-X)))
(TAG(Sim.Device.Polynomial-Coefficient2)*TAG(Sim.Device.Polynomial-X))
TAG(Sim.Device.Polynomial-Coefficient3)
Polynomial - Coefficient1 = 6
Polynomial - Coefficient2 = 10
Polynomial - Coefficient3 = 4
Polynomial - CoefficientX = 2
(6*(2*2)) + (10*2) - 4 = 40
Functions
Functions are used to perform a specific calculation on a tag values or expressions. The result of that process is
returned as the value of the Derived tag.
POW(Base,Exponent)
Sine SIN(TAG(<Tagname>)) This function calculates the Sine of tag value. The result is a
number with the range of -1.0 to 1.0.
www. kepware.com
24 Advanced Tags Help
Examples
Function Formula Result
Absolute ABS(TAG(Sim.Device.Abs1)) If Abs1=-57, the result is 57.
Value
ABS(TAG(Sim.Device.Subtract1)- If Subtract1 is 5 and Subtract2 is 10, the result of the math
TAG(Sim.Device.Subtract2)) is -5 and the result of the Absolute value function is 5.
Logic Tags
Logic tags are used to evaluate an expression to be either True or False and return that result as the value of the
tag. All Logic Derived tags are Boolean data type. A Boolean True can be a 1 or -1 depending on the client
application; a Boolean False is 0.
Examples
Logic Formula Result
Function
And TAG(Sim.Device.And1)AND If And1=0 and And2=97, the result is False. If And1=1 and
Values TAG(Sim.Device.And2) And2=1, the result is True.
And QUALITY(Sim.Device.And1) If both the And1 and the And2 tags have good quality, the result
www. kepware.com
Advanced Tags Help 25
www. kepware.com
26 Advanced Tags Help
<Advanced tag name> is invalid. Verify the tag references valid server tags and does not contain
any references to itself or to an unsupported or array data type.
<Tag name> has an invalid expression: <expression error>.
The complex tag already references <tag name>.
References to array tags with an unsupported or array data type are not allowed <tag name>.
The complex tag already references <tag name> and will not be re-added.
The input and output tags cannot be the same.
The tag must be writeable.
The trigger and output tags cannot be the same.
Unable to start complete tag <tag name> for element <element> on tag <advanced tag name>.
Unable to start complete tag <tag name> on tag <advanced tag name>.
Unable to start element tag <tag name> on tag <advanced tag name>.
Unable to start required tag reference <reference> on tag <tag name>.
Unable to start required tag reference <reference> in expression <expression>.
Unable to start trigger tag <tag name> for element <element> on tag <advanced tag name>.
Unable to start trigger tag <tag name> on tag <advanced tag name>.
<Advanced tag name> is invalid. Verify the tag references valid server tags
and does not contain any references to itself or to an unsupported or array
data type.
Error Type:
Error
Possible Cause:
The tag does not exist in the project, is already referenced, or is an unsupported data type.
Solutions:
Possible Cause:
The expression may contain an unknown tag, misspelled keyword, or syntax error.
Solution:
1. Verify any tags in the expression exist and are valid. Correct as necessary.
2. Check the expression for misspelled keywords and syntax errors. Correct as necessary.
www. kepware.com
Advanced Tags Help 27
References to array tags with an unsupported or array data type are not
allowed <tag name>.
Error Type:
Warning
Possible Cause:
An attempt was made to reference a tag with an unsupported or array data type from an advanced tag.
Solution:
Choose a tag is that is not an array and has a supported data type for the advanced tag type.
The complex tag already references <tag name> and will not be re-added.
Error Type:
Warning
Possible Cause:
An attempt was made to add a tag to the Complex Tag Element List where it was already referenced.
Solution:
Choose a tag to reference that is not already being referenced.
Possible Cause:
The input and output tags for a link tag are the same.
Solution:
Do not use the same tag as both the input and output tag. This creates an invalid circular link.
Possible Cause:
Solution:
Make sure that the tag is writeable. Links require writing to the output tag; derived and complex tags require
writing to the complete tag.
Possible Cause:
The trigger and output tags for a link tag are the same.
Solution:
Do not use the same tag as both the trigger and output tag. This can create an invalid self-triggering link tag.
Unable to start complete tag <tag name> for element <element> on tag
<advanced tag name>.
Error Type:
Warning
www. kepware.com
28 Advanced Tags Help
Possible Cause:
The tag may reference another tag that may have been deleted or renamed.
Solution:
Unable to start complete tag <tag name> on tag <advanced tag name>.
Error Type:
Warning
Possible Cause:
The tag may reference another tag that may have been deleted or renamed.
Solution:
Unable to start element tag <tag name> on tag <advanced tag name>.
Error Type:
Warning
Possible Cause:
The tag may reference another tag that may have been deleted or renamed.
Solution:
Possible Cause:
The tag may reference another tag that may have been deleted or renamed.
Solution:
www. kepware.com
Advanced Tags Help 29
Warning
Possible Cause:
The tag reference in the expression may not exist, has an invalid address, or has an unsupported data type.
Solution:
Verify the tag reference in the expression exists, has a valid address, and has a supported data type. Correct as
necessary.
Unable to start trigger tag <tag name> for element <element> on tag
<advanced tag name>.
Error Type:
Warning
Possible Cause:
The tag may reference another tag that may have been deleted or renamed.
Solution:
Unable to start trigger tag <tag name> on tag <advanced tag name>.
Error Type:
Warning
Possible Cause:
The tag may reference another tag that may have been deleted or renamed.
Solution:
CSV Messages
The following messages may be generated. Click on the link for a description of the message.
Error importing CSV Complex Element record <record index>. Insert by <value> is invalid. Insert
by set to 'Rate'.
Error importing CSV Complex Element record <record index>. Update rate <value><units> is out of
range. Update rate has been set to <value><units>.
Error importing CSV tag <tag name>. Comparison <comparison> is invalid. Comparison set to
Trigger Tag == Value.
Error importing CSV tag <tag name>. Data type <data type> is not valid for the tag type. Data type
has been changed to <data type>.
Error importing CSV tag <tag name>. Maximum value <max value> is out of range. Maximum value
has been set to <max value>.
Error importing CSV tag <tag name>. Run by <value> is invalid. Run by set to 'Rate'.
Error importing CSV tag <tag name>. Run by rate <value><units> is out of range. Run by rate has
been set to <value><units>.
Error importing CSV tag <tag name>. Link mode <link mode> is invalid. Link mode set to On Data
Change of Input Tag.
Error importing CSV tag <tag name>. Trigger type <trigger type> is invalid. Trigger type set to
Always.
www. kepware.com
30 Advanced Tags Help
Error importing CSV tag <tag name>. Trigger scan rate <value> <units> is out of range. Trigger
scan rate has been set to <value> <units>.
Error importing CSV tag <tag name>. Link rate <value> <units> is out of range. Link rate has been
set to <value> <units>.
Error importing CSV tag <tag name>. Update by <update rate> is invalid. Update by set to <update
rate>.
Error importing CSV tag <tag name>. Update rate <value><units> is out of range. Update rate has
been set to <value><units>.
Error importing CSV tag data. No advanced tag records found in CSV file.
Possible Cause:
The insert by action is invalid.
Solution:
Change the insert by action to one that is valid (such as Rate or Trigger).
Error importing CSV complex element record <record index>. Update rate
<value><units> is out of range. Update rate has been set to <value><units>
Error Type:
Warning
Possible Cause:
The complex tag element's update rate is out of range. The provided record index is the position of the complex
tag element record in the complex tag elements section of the CSV file.
Solution:
Change the update rate to one within the valid range.
Note:
The valid range is 10 milliseconds to 49 days.
Possible Cause:
The comparison is invalid.
Solutions:
2. Export the tag to a CSV file and change the comparison to one that is valid, then re-import the CSV file.
Note:
Valid comparisons are as follows: Trigger Tag == value, Trigger Tag != value, Trigger Tag > value, Trigger Tag
>= value, Trigger Tag < value, and Trigger Tag <= value.
Error importing CSV tag <tag name>. Data type <data type> is not valid for
the tag type. Data type has been changed to <data type>.
Error Type:
Warning
Possible Cause:
www. kepware.com
Advanced Tags Help 31
Solution:
Change the tag's data type to one that is valid.
Error importing CSV tag <tag name>. Maximum value <max value> is out of
range. Maximum value has been set to <max value>.
Error Type:
Warning
Possible Cause:
The tag's maximum value is out of range.
Solution:
Change the tag's maximum value to one within the valid range.
Note:
The valid range is the range that can be represented by the tag's data type.
Error importing CSV tag <tag name>. Run by <value> is invalid. Run by set to
'Rate'.
Error Type:
Warning
Possible Cause:
The run by action is invalid.
Solution:
Change the run by action to one that is valid (such as Rate or Trigger).
Error importing CSV tag <tag name>. Run by rate <value><units> is out of
range. Run by rate has been set to <value><units>.
Error Type:
Warning
Possible Cause:
The tag's run by rate is out of range.
Solution:
Change the tag's run by rate to one within the valid range.
Note:
The valid range is 10 milliseconds to 49 days.
Error importing CSV tag <tag name>. Link mode <link mode> is invalid. Link
mode set to On Data Change of Input Tag.
Error Type:
Warning
Possible Cause:
The link mode is invalid.
Solutions:
1. In the user interface, change the tag's link mode to a valid mode.
2. Export the tag to a CSV file and change the link mode to a valid mode, then re-import the CSV file.
Note:
www. kepware.com
32 Advanced Tags Help
The valid modes are On Data Change of Input Tag, On Data Change of Input Tag (Ignore Initial Update), and On
Interval.
Error importing CSV tag <tag name>. Trigger scan rate <value> <units> is out
of range. Trigger scan rate has been set to <value> <units>.
Error Type:
Warning
Possible Cause:
The tag's trigger scan rate is out of range.
Solutions:
1. In the user interface, change the tag's trigger scan rate to a value within the valid range.
2. Export the tag to a CSV file and change the trigger scan rate to a valid value, then re-import the CSV file.
Note:
The valid range is 50 milliseconds to 1800000 milliseconds.
Error importing CSV tag <tag name>. Link mode <link mode> is invalid. Link
mode set to On Data Change of Input Tag.
Error Type:
Warning
Possible Cause:
The link mode is invalid.
Solutions:
1. In the user interface, change the tag's link mode to a valid mode.
2. Export the tag to a CSV file and change the link mode to a valid mode, then re-import the CSV file.
Note:
The valid modes are On Data Change of Input Tag, On Data Change of Input Tag (Ignore Initial Update), and On
Interval.
Error importing CSV tag <tag name>. Trigger type <trigger type> is invalid.
Trigger type set to Always.
Error Type:
Warning
Possible Cause:
The trigger type is invalid.
Solutions:
1. In the user interface, change the tag's trigger type to a valid type .
2. Export the tag to a CSV file and change the trigger type to a valid type , then re-import the CSV file.
Note:
The valid type are Always, While Trigger Comparison True, and On Trigger Comparison True.
Error importing CSV tag <tag name>. Update by <update rate> is invalid.
Update by set to <update rate>.
Error Type:
Warning
Possible Cause:
The Update by rate is out of range.
www. kepware.com
Advanced Tags Help 33
Solution:
Change the Update by rate to one within the valid range.
Note:
The valid range is 50 to 1800000000.
Error importing CSV tag <tag name>. Link rate <value> <units> is out of
range. Link rate has been set to <value> <units>.
Error Type:
Warning
Possible Cause:
The tag's link rate is out of range.
Solutions:
1. In the user interface, change the tag's link rate to a value within the valid range.
2. Export the tag to a CSV file and change the link rate to a valid value, then re-import the CSV file.
Note:
The valid range is 50 milliseconds to 1800000 milliseconds.
Error importing CSV tag <tag name>. Update rate <value><units> is out of
range. Update rate has been set to <value><units>.
Error Type:
Warning
Possible Cause:
The tag's update rate is out of range.
Solution:
Change to the tag's update rate to one within the valid range.
Note:
The valid range is 10 milliseconds to 49 days.
Error importing CSV tag data. No advanced tag records found in CSV file.
Error Type:
Warning
Possible Cause:
The CSV file being imported does not contain any valid advanced tags records.
Solution:
Verify the CSV file's format and contents.
See Also:
Advanced Tags CSV Import and Export
", expected.
( expected.
) expected.
Expression modified.
Numeric expression expected.
Please enter an expression.
String tag expected.
www. kepware.com
34 Advanced Tags Help
", expected.
Error Type:
Warning
Possible Cause:
A string was entered in an expression that is missing a double quote.
Solution:
( expected.
Error Type:
Warning
Possible Cause:
1. A compound expression has been created that is missing an open parenthesis (to pair the close
parenthesis).
2. An open and close parenthesis are next to each other without an operator between.
Solution:
1. Verify the expression and place the parentheses where they belong.
) expected.
Error Type:
Warning
Possible Cause:
1. A compound expression has been created that is missing a close parenthesis (to pair the open
parenthesis).
2. An open and close parenthesis are next to each other without an operator between.
Solution:
1. Verify the expression and place the parentheses where they belong.
Expression modified.
Error Type:
Information
Possible Cause:
The saved expression was modified.
Solution:
www. kepware.com
Advanced Tags Help 35
Possible Cause:
A string expression was created for a numeric derived tag.
Solution:
Create a numeric expression.
Possible Cause:
The expression string field was left blank.
Solution:
Enter an expression.
Possible Cause:
2. An attempt was made to create a string tag, and a non-string tag was referenced as part of the
expression.
Solution:
Possible Cause:
The expression failed a syntax check.
Solution:
Verify the syntax, including the placement of all parentheses.
Possible Cause:
1. A tag was referenced that does not exist in the server project.
2. A tag was referenced that has been deleted from the project.
www. kepware.com
36 Advanced Tags Help
Solution:
Note:
For the proper syntax, refer to the server's help documentation.
Possible Cause:
A constant was used in the expression that is either not numeric or cannot be converted to a numerical value.
Solution:
Change or redefine the constant so that it can be used.
Unterminated string.
Error Type:
Warning
Possible Cause:
Solution:
1. Terminate string constants. To do so, enclose any strings in the expression with double quotes.
www. kepware.com
Advanced Tags Help 37
Index
Complex Tags 11
CSV Error Messages 29
CSV Import/Export 5
Error Descriptions 26
Error importing CSV complex element record <record index>. Insert by <value> is invalid. Insert by set to
'Rate'. 30
Error importing CSV complex element record <record index>. Update rate <value><units> is out of range.
Update rate has been set to <value><units> 30
Error importing CSV tag <tag name>. Comparison <comparison> is invalid. Comparison set to Trigger Tag
== Value. 30
Error importing CSV tag <tag name>. Data type <data type> is not valid for the tag type. Data type has been
changed to <data type>. 30
Error importing CSV tag <tag name>. Link mode <link mode> is invalid. Link mode set to On Data Change of
Input Tag. 31-32
Error importing CSV tag <tag name>. Link rate <value> <units> is out of range. Link rate has been set to
<value> <units>. 33
Error importing CSV tag <tag name>. Maximum value <max value> is out of range. Maximum value has been
set to <max value>. 31
Error importing CSV tag <tag name>. Run by <value> is invalid. Run by set to 'Rate'. 31
Error importing CSV tag <tag name>. Run by rate <value><units> is out of range. Run by rate has been set
to <value><units>. 31
Error importing CSV tag <tag name>. Trigger link mode <link mode> is invalid. Trigger link mode set to
Always. 32
Error importing CSV tag <tag name>. Trigger scan rate <value> <units> is out of range. Trigger scan rate
has been set to <value> <units>. 32
www. kepware.com
38 Advanced Tags Help
Error importing CSV tag <tag name>. Update by <update rate> is invalid. Update by set to <update
rate>. 32
Error importing CSV tag <tag name>. Update rate <value><units> is out of range. Update rate has been set
to <value><units>. 33
Error importing CSV tag data. No advanced tag records found in CSV file. 33
Expected (. 34
Expected ) . 34
Expected comma. 34
Expression modified. 34
Functions 23
Help Contents 4
Link Tags 15
Logic Tags 24
Maximum Tags 19
Minimum Tags 20
www. kepware.com
Advanced Tags Help 39
References to array tags with an unsupported or array data type are not allowed <tag name>. 27
Unable to start complete tag <tag name> for element <element> on tag <advanced tag name>. 27
Unable to start complete tag <tag name> on tag <advanced tag name>. 28
Unable to start element tag <tag name> on tag <advanced tag name>. 28
Unable to start required tag reference <reference> in expression <expression>. 28
Unable to start required tag reference <reference> on tag <tag name>. 28
Unable to start trigger tag <tag name> for element <element> on tag <advanced tag name>. 29
Unable to start trigger tag <tag name> on tag <advanced tag name>. 29
Unknown tag or misspelled keyword: <tag name>. 35
Unrepresentable numeric constant: <tag name>. 36
Unterminated string. 36
www. kepware.com