Back

Topic

[KB764]Expression engine rationalisation

Tags: Expression

10 years ago
By RM
Options
Print
Applies to:

PcVue 11.1 onwards


Summary:

The introduction of the Application Architect in PcVue 10.0 brought a richer syntax for expression calculations. In an effort to rationalize elements of syntax and generalize these enhancements to other usage of expressions such as expressions on variables and expressions in animations, changes were introduced with PcVue 11.1 that may require your attention while migrating applications.


Details:

By Variable Expressions we mean Expression Templates, Expression on Variable, and Expression in an Animation (instead of a variable).

In version 11.1 some syntax elements, operators and functions, were rationalized to make the expression syntax used in Variable Expressions the same as that used in the Application Architect. However some issues and differences remain.

Enclosing variable names in square brackets

Some variable name syntaxes require them to be enclosed in square brackets when used in an expression.

  • The variable name starts with a number.
  • The variable is an alarm counter using a separator that is a non alphanumeric character ($, # etc.)
  • The variable name is a substitution (#V) or contains a substitution (BATT3#).

Example:

=1234REGISTER + Register01 will not work.
=[1234REGISTER] + Register01 can be used instead.

=System.NoAckOn.All.Domain01_$ + System.NoAckOn.All.Domain02_$ will not work.
=[System.NoAckOn.All.Domain01_$] + [System.NoAckOn.All.Domain02_$] can be used instead.

=@Bit01 & #V.BATT3# will not work
=@Bit01 & [#V.BATT3#] can be used instead

Some syntaxes were not recognised as valid

  • Variable name containing a non US standard character (Cyrillic, Chinese etc.). OK in version 11.1.06002 onwards.
  • Temporary variables (…%) in an animation expression. OK in 11.1 release onwards.
  • Variable names such as ?.Varname. OK in version 11.1.06002 onwards.

Changes to the POWER function and POW operator

A power calculation can be achieved with either an operator or a function. PcVue 11.1 suffers from a regression preventing the usage of the POW operator. The issue is fixed in an update for version 11.1. The following table shows what works and what doesn’t.

Version POWER(V1,V2) V1 POW V2

11.0
11.1
11.1 update 10

No
Yes
Yes

Yes
No
Yes

List of functions and operators that are available

The attached document lists the functions and operators that are available. Note that the on-line help does not fully reflect the changes and will be updated in the next version.

Sample project

The attached project contains examples of all expressions, both in the AA and for variables.

Download attachments:


Created on: 15 Apr 2015 Last update: 13 May 2024