Keywords

A keyword is a word with a predefined value. The available keywords are listed below.

Note that keywords are not case sensitive.

Keyword Returned value
E 2.71828182845904523536
Pi 3.14159265358979
SystemTime Evaluates to the system time on the machine evaluating the expression, expressed in seconds since the 1st of January 1970, UTC.
Log10E 0.434294481903251827651
Log2E 1.44269504088896340736
Null A value of Null 
True True 
False False 
Entity The value of the tag or entity (see below for explanation and examples)

Entity

The Entity keyword replaces the THIS keyword from version 2.6.

Entity applies to the parent entity when a calculation is assigned as an attribute. For calculations assigned as attributes, the Entity keyword will be substituted by the parent entity name, provided that Entity is surrounded by non-alphanumeric characters (that is, it does not appear as part of another word).

In P2 Server, tags must be written between curly braces.

You can use the Entity keyword in 2 ways:.

In Entities

You can use Entity as a keyword to get back the name of the parent entity. 

If you have entity1:attr1 with the expression "'parent entity is: ' + entity" it would return a single value with a string data type of :
parent entity is: entity1

The syntax for specifying an attribute is as follows:

{Entity:AttributeDefinition}
{Entity[TemplateDefinition]:AttributeDefinition}
{Entity:AttributeDefinition!AttributeValueDefinition}
{Entity[TemplateDefinition]:AttributeDefinition!AttributeValueDefinition}

In Tags

You can use the Entity keyword in tag expressions. For example, you could create the following attributes and tags:

CalculatedDoubleTHP = {entity:THP} * 2
Well1:DoubleTHP = {CalculatedDoubleTHP}
Well2:DoubleTHP = {CalculatedDoubleTHP}

In this case, Entity would get replaced with Well1 or Well2 depending on which attribute is evaluated.

 

Comments are closed