Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Historian

Chart data with expressions

  • Last UpdatedJan 25, 2024
  • 5 minute read

Expressions allow you to perform mathematical and logical operations on tag data.

Note: Using expressions requires the "advanced" license feature to be enabled. If the advanced license is not available when an expression is used, no data is retrieved and an error message is displayed.

What is an expression?

An expression is made up of a combination of the following elements:

  1. Values

    • A typical value is made up of three components:

      • A value with a base type of Boolean, integer, or double

      • A date and time in UTC format

      • A 16-bit integer representing the OPC quality of the value

    • Literal values are also supported, which have no date and time associated with them, and are always assumed to be "good" quality.

  2. Streams

    • A stream is a time-ordered collection of values. A stream has either a stair-step or linear interpolation model, and an associated engineering unit.

    • In the context of an expression, one tag is the initial stream, but the expression can produce additional streams derived from a tag. For example, the expression TI101.PV + 4.0 produces a result stream, but the initial stream is the stream associated with TI101.PV.

  3. Arithmetic and logical operators

    • Standard arithmetic operators such as addition, subtraction, multiplication and division are supported, along with logical operators for comparison, such as greater than (>) and less than (<). For a full list of supported operators, see Supported arithmetic operators.

  4. Scalar functions

    • A variety of scalar functions are supported for manipulating data, such as calculating the absolute value, rounding values to the nearest integer, or unit of measure conversion. For a full list of supported scalar functions, see Supported scalar functions.

  5. Time-series functions

    • A variety of time-series functions are supported for comparing data, such as calculating minimum/maximum values, or time in state. For a full list of supported functions, see Supported time-series functions.

    • Time intervals can be expressed in either of two ways:

      1. As a number of days. For example, a value of 1 represents a daily period, while a value of .125 represents a period of three hours.

        Note: Daily time periods support Daylight Saving Time. This means the "1 day" period is 24 hours, except on days when the Daylight Saving Time change is made; on those days, it will be either 23 or 25 hours.

      2. As a named period. The following named periods are supported: minute, hour, day, week, month, fixedday, fixedweek, fixedmonth. These periods are anchored to a rounded time period. For example, "hour" produces hourly intervals where the minutes, seconds and milliseconds are all 0 in local time, while "minute" produces intervals where the seconds and milliseconds are all 0 in local time.

        Note: The day, week and month named periods support Daylight Saving Time, while the fixedday, fixedweek and fixedmonth named periods do not. For example, the length of a day period can be 23, 24, or 25 hours, depending on whether a Daylight Saving Time transition takes place. The length of a fixedday period is always 24 hours, fixedweek is always 7 days times 24 hours, and fixedmonth is always the number of calendar days in the month times 24 hours.

To enter an expression:

  1. In the search bar, select the icon to switch to expression mode.

    Search field

    Note: If you do not see the icon, either your system does not have the advanced feature license activated, or your administrator has disabled expression mode.

  2. In this mode, the search results list displays suggestions for completing expressions, in addition to content and data matching your search term. Enter your expression by typing into the search bar. You can also select an item from the list of suggestions to insert it into your expression.

    Expression search with suggestions.

  3. As you enter your expression into the search bar, AVEVA Historian Client Web recognizes the use of functions, and offers you suggestions for completing the function by showing you the various options available to you as you type. Other suggestions can include tag names, existing chart data, or function names, depending on the context of your expression as you build it.

    Expression search with results.

  4. When the expression is complete, press Enter. If the expression is valid, it is added to your chart.

    Note: The case-sensitivity of tag names in expressions depends on the collation setting of the SQL Server, while function names are always case-insensitive. AVEVA Historian Client Web prevents you from adding the same expression to your chart multiple times. For example, if the SQL Server's collation is not case-sensitive, the two expressions SysTimeMin + SysTimeHour and systimemin + systimehour are considered identical, so the second one cannot be added after the first. If the server's collation is case-sensitive, both expressions can be added to your chart. As another example, the two expressions AVERAGE(Pump1.FlowRate) and average(Pump1.FlowRate) are considered identical because function names are case-insensitive.

  5. To return to standard search mode, select in the search bar.

    TitleResults for “How to create a CRG?”Also Available in