Logical expressions involving physical quantities.
If the expression contains unit qualified values, or attributes with a physical dimension then these values are converted to consistent units before comparison
If a value is not unit qualified it is assumed to be in current units of the quantity defined by the other value (i.e. the context of the expression). For example if current units of mass (colloquially weight) are oz then
But if current units of mass are kg then expression will return FALSE as 2lb is not equal to 2kg.
If the units are not units of the same physical quantity FALSE will always be returned as the two values are completely incompatible (as are apples and pears) and a warning issued (for example, (2lb equal 32mm).
The logical operators available are:
AND

EQ, NE
The operators EQ and NE may be applied to any pair of values of the same type.
GT, GE, LE, LT
The operators GE, LE, GT and LT may only be used with numbers and positions. For more information, see Positions, Directions and Orientations in Expressions.
NOT

OR

log1 AND log2
-> logical
Perform the logical AND between two logical values. Treats unset values as FALSE.
If one of the values is undefined and the other one is FALSE, the result is FALSE.
TRUE and FALSE -> FALSE
Compare two values. A special feature is used for the positions, only the coordinates specified are compared. Refer to Compare Positions for more information. Unset values result in FALSE across EQ, TRUE across NE.
If two positions have no common coordinate, for example, ’N 10 ne U 10’, the result is undefined. Units are consolidated across comparisons.
( 1.0 eq 2.0) -> FALSE
None.
( number1 GT number2 )
> logical
( pos1 GT pos2 )
> logical
( number1 GE number2 )
> logical
( pos1 GE pos2 )
> logical
( number1 LE number2 )
> logical
( pos1 LE pos2 )
> logical
( number1 LT number2 )
> logical
( pos1 LT pos2 )
> logical
Compare two values. A special feature is used for positions: only the coordinates specified are compared. See Compare Positions for more information. For positions, since comparisons may be performed on more than one value, LT (GT) is not the inverse of GE (LE). Unset values result in false
If two positions have no common coordinate, the result is undefined. For example, ’N 10 gt U 10’.
Units are consolidated across comparisons.
( 1.0 LT 2.0) -> TRUE
( N 0 E 10 GT N 10 E 0 ) -> FALSE
( N 0 E 10 GT N 10 E 0 ) -FALSE
None.
NOT log1
-> logical
Perform the logical NOT on a logical value.
None.
not TRUE -> FALSE
None.
OR log2
-> logical
Perform the logical inclusive OR between two logical values. (The exclusive OR is defined by using NE.)
Allows numbers instead of logical values.
If one of the values is undefined and the other one is TRUE, the result is TRUE.
TRUE or FALSE -> TRUE
None.

Operator
Comments
AND
EQ, NE
The operators EQ and NE may be applied to any pair of values of the same type.
GT, GE, LE, LT
The operators GE, LE, GT and LT may only be used with numbers and positions. For more information, see Positions, Directions and Orientations in Expressions.
NOT
OR
Synopsis
log1 AND log2
-> logical
Description
Perform the logical AND between two logical values. Treats unset values as FALSE.
Side Effects
If one of the values is undefined and the other one is FALSE, the result is FALSE.
Example
TRUE and FALSE -> FALSE
Synopsis
( number1 EQual number2)
-> logical
( text1 EQual text2 )
-> logical
( log1 EQual log2 )
-> logical
( id1 EQual id2 )
-> logical
( pos1 EQual pos2 )
-> logical
( dir1 EQual dir2 )
-> logical
( ori1 EQual ori2 )
-> logical
( pp1 EQual pp2 )
-> logical
( number1 NEqual number2 )
-> logical
( text1 NEqual text2 )
-> logical
( log1 NEqual log2 )
-> logical
( id1 NEqual id2 )
-> logical
( pos1 NEqual pos2 )
-> logical
( dir1 NEqual dir2 )
-> logical
( ori1 NEqual ori2 )
-> logical
( pp1 NEqual pp2 )
-> logical
Description
Compare two values. A special feature is used for the positions, only the coordinates specified are compared. Refer to Compare Positions for more information. Unset values result in FALSE across EQ, TRUE across NE.
Side Effects
If two positions have no common coordinate, for example, ’N 10 ne U 10’, the result is undefined. Units are consolidated across comparisons.
Example
( 1.0 eq 2.0) -> FALSE
Errors
None.
Synopsis
( number1 GT number2 )
> logical
( pos1 GT pos2 )
> logical
( number1 GE number2 )
> logical
( pos1 GE pos2 )
> logical
( number1 LE number2 )
> logical
( pos1 LE pos2 )
> logical
( number1 LT number2 )
> logical
( pos1 LT pos2 )
> logical
Description
Compare two values. A special feature is used for positions: only the coordinates specified are compared. See Compare Positions for more information. For positions, since comparisons may be performed on more than one value, LT (GT) is not the inverse of GE (LE). Unset values result in false
Side Effects
If two positions have no common coordinate, the result is undefined. For example, ’N 10 gt U 10’.
Units are consolidated across comparisons.
Example
( 1.0 LT 2.0) -> TRUE
( N 0 E 10 GT N 10 E 0 ) -> FALSE
( N 0 E 10 GT N 10 E 0 ) -FALSE
Errors
None.
Synopsis
NOT log1
-> logical
Description
Perform the logical NOT on a logical value.
Side Effects
None.
Example
not TRUE -> FALSE
Errors
None.
Synopsis
OR log2
-> logical
Description
Perform the logical inclusive OR between two logical values. (The exclusive OR is defined by using NE.)
Allows numbers instead of logical values.
Side Effects
If one of the values is undefined and the other one is TRUE, the result is TRUE.
Example
TRUE or FALSE -> TRUE
Errors
None.
( number1 EQual number2)
-> logical
( text1 EQual text2 )
-> logical
( log1 EQual log2 )
-> logical
( id1 EQual id2 )
-> logical
( pos1 EQual pos2 )
-> logical
( dir1 EQual dir2 )
-> logical
( ori1 EQual ori2 )
-> logical
( pp1 EQual pp2 )
-> logical
( number1 NEqual number2 )
-> logical
( text1 NEqual text2 )
-> logical
( log1 NEqual log2 )
-> logical
( id1 NEqual id2 )
-> logical
( pos1 NEqual pos2 )
-> logical
( dir1 NEqual dir2 )
-> logical
( ori1 NEqual ori2 )
-> logical
( pp1 NEqual pp2 )
-> logical
Note:
The operators EQ, NE, LT, GT, LE and GE are sometimes referred to as comparator or relational operators; NOT, AND and OR are sometimes referred to as Boolean operators. Refer to Precision of Comparisons for tolerances in comparing numbers.

Positions, Directions and Orientations in Expressions
Precision of Comparisons
Compare Positions
Compare Positions
Positions, Directions and Orientations in Expressions
Note
:
comparator
relational
Boolean
Precision of Comparisons
Synopsis
log1 AND log2
-> logical
Description
Side Effects
Example
TRUE and FALSE -> FALSE
EQ and NE
Synopsis
Description
Compare Positions
Side Effects
’N 10 ne U 10’
Example
( 1.0 eq 2.0) -> FALSE
Errors
Synopsis
( number1 GT number2 )
> logical
( pos1 GT pos2 )
> logical
( number1 GE number2 )
> logical
( pos1 GE pos2 )
> logical
( number1 LE number2 )
> logical
( pos1 LE pos2 )
> logical
( number1 LT number2 )
> logical
( pos1 LT pos2 )
> logical
Description
Compare Positions
Side Effects
’N 10 gt U 10
Example
( 1.0 LT 2.0) -> TRUE
( N 0 E 10 GT N 10 E 0 ) -> FALSE
( N 0 E 10 GT N 10 E 0 ) -FALSE
Errors
Synopsis
NOT log1
-> logical
Description
Side Effects
Example
not TRUE -> FALSE
Errors
Synopsis
OR log2
-> logical
Description
Side Effects
Example
TRUE or FALSE -> TRUE
Errors


The logical functions available are:
BADREF
DEFINED,UNDEFINED
CREATED
DELETED
EMPTY
IFTRUE
MATCHWILD
MODIFIED
UNSET
VLOGICAL
BADREF

DEFINED,UNDEFINED

CREATED

DELETED

EMPTY

IFTRUE

MATCHWILD

MODIFIED

UNSET

VLOGICAL

BADREF (id)
-> logical
TRUE if id is invalid, else FALSE.
None
BADREF(TREF) -> ’true’ if TREF=nulref
None.
DEFined (variable_name)
-> logical
DEFined (variable_name,number)
-> logical
UNDEFined (variable_name)
-> logical
UNDEFined (variable_name , number)
-> logical
With one argument, DEFINED is true only if the scalar variable, the array variable or the array variable element exists.
With two arguments, DEFINED is true only if the first argument is an array variable which has a value for the index denoted by the second argument.
UNDEFINED( !foo ) is equivalent to NOT DEFINED( !foo ).
None.
DEFINED ( !var ) -> TRUE
DEFINED ( !array ) -> TRUE
DEFINED ( !array[1] )) -> TRUE
DEFINED ( !array , 1 ) -> TRUE
DEFINED ( !var) -> FALSE
UNDEFINED ( !array) -> TRUE
DEFINED ( !array , 3 ) -> FALSE
None.
CREATED
-> logical
Returns TRUE if the element has been created since the set date.
None.
CREATED -> TRUE
None.
DELETED
-> logical
Returns TRUE if the element has been deleted since the set date.
None.
DELETED -> TRUE
None.
EMPTY(text)
-> logical
Returns TRUE if text is a zero length string, else FALSE
None.
EMPTY(‘’) -> TRUE
EMPTY(‘not empty’) -> FALSE
None.
IFTrue(logical, anyA, anyB)
-> logical
The first argument is a logical value or expression.
The second and third arguments may be of any type BUT THEY MUST BE OF THE SAME TYPE.
Returns a value that is the SAME TYPE as the second and third arguments.
Returns anyA if logical evaluates to TRUE, anyB if logical evaluates to FALSE.
anyA and anyB can be IFTRUE functions themselves (as long as they return consistent types) so IF constructs can be nested.ds.
None.
IFT (SPREF EQ /A3B/GC50, 'BLUE', 'RED'
iftrue (gwei gt 1tonne, /INSUL/THICK, /INSUL/THIN)
-> BLUE
->INSUL/THICK
Normal number of argument errors and Mismatched second and third arguments:
(2,497) TYPE MISMATCH: unmatched or illegal argument type for IFTRUE function.
MATCHW/ILD( text1, text2)
-> logical
MATCHW/ILD( text1, text2, text3)
-> logical
MATCHW/ILD( text1, text2, text3, text4)
-> logical
Matches string text2 to string text1. If they are the same then returns TRUE, else FALSE. text2 may contain wildcard characters.
The defaults for wildcards are ‘*’ for any number of characters, and ‘?’ for a single character.
With three arguments, the multiple wildcard character ‘*’ may be redefined by text3.
With four arguments the single wildcard character ‘?’ may be redefined by text4.
None
MATCHW/ILD(’** text’,’**!’,’!’) -> TRUE
None.

                                   .-----------------------------------.
                                 /                                    |
>- MODIFIED-(-+- attname -------*- DESCENDANTS ‑-+-+-comma +-attname ‑’
              |                 |                | |
              |- DESCENDANTS -. |- SIGNIFICANT --| |
              |               | |                | |
              |- SIGNIFICANT--| |- PRIMARY ----- | |
              |               | |                | |
              |- PRIMARY -----| |- OFFSPRING-----| |
              |               | |                | |
              |- OFFSPRING ---| ‘----------------’ |
              |               |                    |
              |               |                    |
              |               |                    |
              ‘---------------+--------------------+--+-- ) - OF ‑ id Æ
                                                  |
                                                   ‘-Æ

For sophisticated queries relating to modifications. Returns TRUE if a modification has taken place.
Each attribute name may be followed by the following qualifying keywords:
OFFSPRING, to check this element and members
SIGNIF, to check all elements for which this element represents the significant one;
PRIMARY, check all elements for which this element represents the primary one;
DESCENDANTS, this element and everything below (descendants).
The ‘OF’ syntax may be used as for attributes.
The MODIFIED function or the GEOM, CATTEXT and CATMOD pseudo-attributes.
The MODIFIED, DELETED and CREATED functions may go anywhere within an AVEVA E3D™ PML1 expression. i.e. after Q/VAR and within collections
None
Q (MODIFIED())
Returns TRUE if element has changed at all since the comparison date.
It will also return TRUE if the element has been created since the comparison date.
Q MODIFIED(POS,ORI)
Returns TRUE if POS or ORI modified since the comparison date.
Q MODIFIED(P1 POS)
Returns TRUE if the position of P1 has changed.
Q MODIFIED(GEOM DESCENDANTS
Returns TRUE if any geometry for item or any descendants has changed
Q MODIFIED(PRIMARY)
Returns TRUE if any element for which this element is primary, has changed.
Q MODIFIED() OF /PIPE1
Returns TRUE if /PIPE1 has been modified since the comparison date.
Q (BUIL OR MODIFIED()OR ELECREC OF NEXT )

None.
The MODIFIED, DELETED and CREATED functions are not implemented within PML2 expressions.
UNSET(value)
-> logical
Returns TRUE if value is unset, else FALSE. The value can be of any data type including ARRAYS. Normally it will be an AVEVA E3D™ attribute.
None.
UNSET( DESC )
TRUE where DESC is an unset text attribute
UNSET(CRFA)
FALSE where CRFA contains unset reference attributes
None.
VLOGICAL is used for the late evaluation of variables.
VLOGICAL ( variable_name ))
-> logical
VLOGICAL ( variable_name , number)
-> logical
With one argument, return the value of the scalar variable or the value of the array variable element as a logical.
With two arguments, return the value of the element corresponding to the index number as a logical.
The rules of conversion are:
TRUE for the strings ’T’, ’TR’, ’TRU’ or ’TRUE’ (case insensitive) or any numeric value not equal to zero;
FALSE for the strings ’F’, ’FA’, ’FAL’, ’FALS’ or ’FALSE’ (case insensitive) or a numeric value equal to zero.
Scalar variables may not be indexed. For example, VTEXT(!var[1]) will return an error.
Array variables must have an index. For example, VTEXT (!array) will return an error.
The value cannot be translated into a logical.
See also VTEXT, used for late evaluation when a text result is required; and VVALUE, used for late evaluation when a numeric result is required.
If the scalar variable, the array variable, or the array variable element does not exist, the result is undefined.
VLOG ( !array[1] ) -> TRUE
VLOG ( !array , 2 ) -> FALSE
None.

BADREF
DEFINED,UNDEFINED
CREATED
DELETED
EMPTY
IFTRUE
MATCHWILD
MODIFIED
UNSET
VLOGICAL
Synopsis
BADREF (id)
-> logical
Description
TRUE if id is invalid, else FALSE.
Side Effects
None
Example
BADREF(TREF) -> ’true’ if TREF=nulref
Errors
None.
Synopsis
DEFined (variable_name)
-> logical
DEFined (variable_name,number)
-> logical
UNDEFined (variable_name)
-> logical
UNDEFined (variable_name , number)
-> logical
Description
With one argument, DEFINED is true only if the scalar variable, the array variable or the array variable element exists.
With two arguments, DEFINED is true only if the first argument is an array variable which has a value for the index denoted by the second argument.
UNDEFINED( !foo ) is equivalent to NOT DEFINED( !foo ).
Side Effects
None.
Example
DEFINED ( !var ) -> TRUE
DEFINED ( !array ) -> TRUE
DEFINED ( !array[1] )) -> TRUE
DEFINED ( !array , 1 ) -> TRUE
DEFINED ( !var) -> FALSE
UNDEFINED ( !array) -> TRUE
DEFINED ( !array , 3 ) -> FALSE
Errors
None.
Synopsis
CREATED
-> logical
Description
Returns TRUE if the element has been created since the set date.
Side Effects
None.
Example
CREATED -> TRUE
Errors
None.
Synopsis
DELETED
-> logical
Description
Returns TRUE if the element has been deleted since the set date.
Side Effects
None.
Example
DELETED -> TRUE
Errors
None.
Synopsis
EMPTY(text)
-> logical
Description
Returns TRUE if text is a zero length string, else FALSE
Side Effects
None.
Example
EMPTY(‘’) -> TRUE
EMPTY(‘not empty’) -> FALSE
Errors
None.
Synopsis
IFTrue(logical, anyA, anyB)
-> logical
The first argument is a logical value or expression.
The second and third arguments may be of any type BUT THEY MUST BE OF THE SAME TYPE.
Returns a value that is the SAME TYPE as the second and third arguments.
Description
Returns anyA if logical evaluates to TRUE, anyB if logical evaluates to FALSE.
anyA and anyB can be IFTRUE functions themselves (as long as they return consistent types) so IF constructs can be nested.ds.
Side Effects
None.
Example
IFT (SPREF EQ /A3B/GC50, 'BLUE', 'RED'
iftrue (gwei gt 1tonne, /INSUL/THICK, /INSUL/THIN)
-> BLUE
->INSUL/THICK
Errors
Normal number of argument errors and Mismatched second and third arguments:
(2,497) TYPE MISMATCH: unmatched or illegal argument type for IFTRUE function.
Synopsis
MATCHW/ILD( text1, text2)
-> logical
MATCHW/ILD( text1, text2, text3)
-> logical
MATCHW/ILD( text1, text2, text3, text4)
-> logical
Description
Matches string text2 to string text1. If they are the same then returns TRUE, else FALSE. text2 may contain wildcard characters.
The defaults for wildcards are ‘*’ for any number of characters, and ‘?’ for a single character.
With three arguments, the multiple wildcard character ‘*’ may be redefined by text3.
With four arguments the single wildcard character ‘?’ may be redefined by text4.
Side Effects
None
Example
MATCHW/ILD(’A big bottle of beer’,’*big*’) -> TRUE
MATCHW/ILD(’A big bottle of beer’,’??big*’) -> TRUE
MATCHW/ILD(’A big bottle of beer’,’???*big*’) -> FALSE
MATCHW/ILD(’A big bottle of beer’,’*big*beer’) -> TRUE
MATCHW/ILD(’** text’,’**!’,’!’) -> TRUE
Errors
None.
Synopsis
                                   .-----------------------------------.
                                 /                                    |
>- MODIFIED-(-+- attname -------*- DESCENDANTS ‑-+-+-comma +-attname ‑’
              |                 |                | |
              |- DESCENDANTS -. |- SIGNIFICANT --| |
              |               | |                | |
              |- SIGNIFICANT--| |- PRIMARY ----- | |
              |               | |                | |
              |- PRIMARY -----| |- OFFSPRING-----| |
              |               | |                | |
              |- OFFSPRING ---| ‘----------------’ |
              |               |                    |
              |               |                    |
              |               |                    |
              ‘---------------+--------------------+--+-- ) - OF ‑ id Æ
                                                  |
                                                   ‘-Æ
Description
For sophisticated queries relating to modifications. Returns TRUE if a modification has taken place.
Each attribute name may be followed by the following qualifying keywords:
OFFSPRING, to check this element and members
SIGNIF, to check all elements for which this element represents the significant one;
PRIMARY, check all elements for which this element represents the primary one;
DESCENDANTS, this element and everything below (descendants).
The ‘OF’ syntax may be used as for attributes.
The MODIFIED function or the GEOM, CATTEXT and CATMOD pseudo-attributes.
The MODIFIED, DELETED and CREATED functions may go anywhere within an AVEVA E3D™ PML1 expression. i.e. after Q/VAR and within collections
Side Effects
None
Example
Q (MODIFIED())
Returns TRUE if element has changed at all since the comparison date.
It will also return TRUE if the element has been created since the comparison date.
Q MODIFIED(POS,ORI)
Returns TRUE if POS or ORI modified since the comparison date.
Q MODIFIED(P1 POS)
Returns TRUE if the position of P1 has changed.
Q MODIFIED(GEOM DESCENDANTS
Returns TRUE if any geometry for item or any descendants has changed
Q MODIFIED(PRIMARY)
Returns TRUE if any element for which this element is primary, has changed.
Q MODIFIED() OF /PIPE1
Returns TRUE if /PIPE1 has been modified since the comparison date.
Q (BUIL OR MODIFIED()OR ELECREC OF NEXT )
Errors
None.
Synopsis
UNSET(value)
-> logical
Description
Returns TRUE if value is unset, else FALSE. The value can be of any data type including ARRAYS. Normally it will be an AVEVA E3D™ attribute.
Side Effects
None.
Example
UNSET( DESC )
TRUE where DESC is an unset text attribute
UNSET(CRFA)
FALSE where CRFA contains unset reference attributes
Errors
None.
Synopsis
VLOGICAL ( variable_name ))
-> logical
VLOGICAL ( variable_name , number)
-> logical
Description
With one argument, return the value of the scalar variable or the value of the array variable element as a logical.
With two arguments, return the value of the element corresponding to the index number as a logical.
The rules of conversion are:
TRUE for the strings ’T’, ’TR’, ’TRU’ or ’TRUE’ (case insensitive) or any numeric value not equal to zero;
FALSE for the strings ’F’, ’FA’, ’FAL’, ’FALS’ or ’FALSE’ (case insensitive) or a numeric value equal to zero.
Scalar variables may not be indexed. For example, VTEXT(!var[1]) will return an error.
Array variables must have an index. For example, VTEXT (!array) will return an error.
The value cannot be translated into a logical.
See also VTEXT, used for late evaluation when a text result is required; and VVALUE, used for late evaluation when a numeric result is required.
Side Effects
If the scalar variable, the array variable, or the array variable element does not exist, the result is undefined.
Example
VLOG ( !array[1] ) -> TRUE
VLOG ( !array , 2 ) -> FALSE
Errors
None.

Synopsis
BADREF (id)
-> logical
Description
id
Side Effects
Example
BADREF(TREF) -> ’true’ if TREF=nulref
Errors
Synopsis
DEFined (variable_name)
-> logical
DEFined (variable_name,number)
-> logical
UNDEFined (variable_name)
-> logical
UNDEFined (variable_name , number)
-> logical
Description
Side Effects
Example
DEFINED ( !var ) -> TRUE
DEFINED ( !array ) -> TRUE
DEFINED ( !array[1] )) -> TRUE
DEFINED ( !array , 1 ) -> TRUE
DEFINED ( !var) -> FALSE
UNDEFINED ( !array) -> TRUE
DEFINED ( !array , 3 ) -> FALSE
Errors
Synopsis
CREATED
-> logical
Description
Side Effects
Example
CREATED -> TRUE
Errors
Synopsis
DELETED
-> logical
Description
Side Effects
Example
DELETED -> TRUE
Errors
Synopsis
EMPTY(text)
-> logical
Description
Side Effects
Example
EMPTY(‘’) -> TRUE
EMPTY(‘not empty’) -> FALSE
Errors
Synopsis
IFTrue(logical, anyA, anyB)
-> logical
Description
Side Effects
Example
IFT (SPREF EQ /A3B/GC50, 'BLUE', 'RED'
iftrue (gwei gt 1tonne, /INSUL/THICK, /INSUL/THIN)
-> BLUE
->INSUL/THICK
Errors
Synopsis
MATCHW/ILD( text1, text2)
-> logical
MATCHW/ILD( text1, text2, text3)
-> logical
MATCHW/ILD( text1, text2, text3, text4)
-> logical
Description
text2
text1
text2
text3
text4
Side Effects
Example
MATCHW/ILD(’** text’,’**!’,’!’) -> TRUE
Errors
Synopsis
                                 .-----------------------------------.
                                 /                                    |
>- MODIFIED-(-+- attname -------*- DESCENDANTS ‑-+-+-comma +-attname ‑’
              |                 |                | |
              |- DESCENDANTS -. |- SIGNIFICANT --| |
              |               | |                | |
              |- SIGNIFICANT--| |- PRIMARY ----- | |
              |               | |                | |
              |- PRIMARY -----| |- OFFSPRING-----| |
              |               | |                | |
              |- OFFSPRING ---| ‘----------------’ |
              |               |                    |
              |               |                    |
              |               |                    |
              ‘---------------+--------------------+--+-- ) - OF ‑ id Æ
                                                  |
                                                   ‘-Æ
Description
Side Effects
Example
Q (MODIFIED())
Q MODIFIED(POS,ORI)
Q MODIFIED(P1 POS)
Q MODIFIED(GEOM DESCENDANTS
Q MODIFIED(PRIMARY)
Q MODIFIED() OF /PIPE1
Q (BUIL OR MODIFIED()OR ELECREC OF NEXT )
Errors
Synopsis
UNSET(value)
-> logical
Description
value
Side Effects
None.
Example
UNSET( DESC )
TRUE where DESC is an unset text attribute
UNSET(CRFA)
FALSE where CRFA contains unset reference attributes
Errors
Synopsis
VLOGICAL ( variable_name ))
-> logical
VLOGICAL ( variable_name , number)
-> logical
Description
VTEXT(!var[1])
VTEXT (!array)
Side Effects
Example
VLOG ( !array[1] ) -> TRUE
VLOG ( !array , 2 ) -> FALSE
Errors


Logical array expressions can contain:
AVEVA E3D Design attributes of type logical array. For example, LOGARR where LOGARR is a User Dfined Attribute (UDA) of type logical.
Logical constants. The constants available are: TRUE, ON, YES for true; and FALSE, OFF, NO for false.
Logical operators. Refer to Logical Operators.
Logical functions. Refer to Logical Functions.
AVEVA E3D Design attributes of type logical array. For example, LOGARR where LOGARR is a User Dfined Attribute (UDA) of type logical.
AVEVA E3D Design attributes of type logical array. For example, LOGARR where LOGARR is a User Dfined Attribute (UDA) of type logical.
Logical constants. The constants available are: TRUE, ON, YES for true; and FALSE, OFF, NO for false.
Logical constants. The constants available are: TRUE, ON, YES for true; and FALSE, OFF, NO for false.
Logical operators. Refer to Logical Operators.
Logical operators. Refer to Logical Operators.
Logical functions. Refer to Logical Functions.
Logical functions. Refer to Logical Functions.

Logical Operators
Logical Functions
Logical Operators
.
Logical Functions
.


In AVEVA E3D Design expressions, integers are treated as reals; they are fully interchangeable. Numeric expressions can contain:
Numbers, for example: 32, 10.1.
Numbers can be given as integer exponents, for example: 10 exp 5, and 5 E 6.
Values (numbers) can be qualified by units. This introduces dimensional analysis into the expression. The valid units are any standard appropriate unit qualifiers for example MM, M/etres, IN/ches, FT, FEET, kg, lb, kgf/m3, pascal. These may be preceded by SQU/are, CUBIC, CUB/e to denote non-linear Values, or alternatively they can have power indices appended. For example: 100 mm, 10 exp 5 cubic feet, 10m3, 20newton.m-2. Feet and inches can be shown as, for example, 10'6.
AVEVA E3D Design attributes of type number, for example: XLEN.
Position, direction and orientation attributes which have a subscript to indicate which part of the array is required. For example, POS[2] means the second element of the POSITION attribute; that is, the northing.
Note:
Position, direction and orientation attributes without subscripts can only be used in number array expressions.
The keyword PI (3.142).
Numeric operators.
Numeric functions.
Numbers, for example: 32, 10.1.
Numbers, for example: 32, 10.1.
Numbers can be given as integer exponents, for example: 10 exp 5, and 5 E 6.
Numbers can be given as integer exponents, for example: 10 exp 5, and 5 E 6.
Values (numbers) can be qualified by units. This introduces dimensional analysis into the expression. The valid units are any standard appropriate unit qualifiers for example MM, M/etres, IN/ches, FT, FEET, kg, lb, kgf/m3, pascal. These may be preceded by SQU/are, CUBIC, CUB/e to denote non-linear Values, or alternatively they can have power indices appended. For example: 100 mm, 10 exp 5 cubic feet, 10m3, 20newton.m-2. Feet and inches can be shown as, for example, 10'6.
Values (numbers) can be qualified by units. This introduces dimensional analysis into the expression. The valid units are any standard appropriate unit qualifiers for example MM, M/etres, IN/ches, FT, FEET, kg, lb, kgf/m3, pascal. These may be preceded by SQU/are, CUBIC, CUB/e to denote non-linear Values, or alternatively they can have power indices appended. For example: 100 mm, 10 exp 5 cubic feet, 10m3, 20newton.m-2. Feet and inches can be shown as, for example, 10'6.
AVEVA E3D Design attributes of type number, for example: XLEN.
AVEVA E3D Design attributes of type number, for example: XLEN.
Position, direction and orientation attributes which have a subscript to indicate which part of the array is required. For example, POS[2] means the second element of the POSITION attribute; that is, the northing.
Note:
Position, direction and orientation attributes without subscripts can only be used in number array expressions.
Position, direction and orientation attributes which have a subscript to indicate which part of the array is required. For example, POS[2] means the second element of the POSITION attribute; that is, the northing.
The keyword PI (3.142).
The keyword PI (3.142).
Numeric operators.
Numeric operators.
Numeric functions.
Numeric functions.

POS[2]
Note


The numeric operators available are:
+
Addition.
-
Subtraction.
*
Multiplication.
/
Division.

Operator
Comments
+
Addition.
-
Subtraction.
*
Multiplication.
/
Division.


The add and subtract functions available are
number + number
-> number
number ‑ number
-> number
+ number
-> number
- number
-> number
Add or subtract two numbers. They can also be used as unary operators at the beginning of a parenthesized sub-expression.
Units are consolidated across add and subtract and the result is returned in current units of the physical quantity, for example when current distance units are inches
If only one value has a unit qualifier the other is assumed to be in current units of that physical quantity for example:
If the two values have conflicting units a warning is issued and a value is returned with no units assuming both values are in the database units of their respective quantities which is mm and Kg in the example:
q (1ft + 1kg ) will return 305.8
1 + 2 -> 3.0
1 ‑ 2 -> 1.0
+ 1 -> 1.0
- 1 -> -1.0
Floating point underflow.

Synopsis
number + number
-> number
number ‑ number
-> number
+ number
-> number
- number
-> number
Description
Add or subtract two numbers. They can also be used as unary operators at the beginning of a parenthesized sub-expression.
Side Effects
Units are consolidated across add and subtract and the result is returned in current units of the physical quantity, for example when current distance units are inches
q (1ft + 100mm) will return 15.9in
If only one value has a unit qualifier the other is assumed to be in current units of that physical quantity for example:
q (1ft + 100 ) will return 112in
If the two values have conflicting units a warning is issued and a value is returned with no units assuming both values are in the database units of their respective quantities which is mm and Kg in the example:
q (1ft + 1kg ) will return 305.8
Example
1 + 2 -> 3.0
1 ‑ 2 -> 1.0
+ 1 -> 1.0
- 1 -> -1.0
Errors
Floating point underflow.

Synopsis
number + number
-> number
number ‑ number
-> number
+ number
-> number
- number
-> number
Description
Side Effects
Example
1 + 2 -> 3.0
1 ‑ 2 -> 1.0
+ 1 -> 1.0
- 1 -> -1.0
Errors


The multiply and divide functions available are
number * number
-> number
number / number
-> number
Multiply or divide two numbers. They can also be used as unary operators at the beginning of a parenthesized sub-expression. Numeric underflow is not considered to be an error and neither is it flagged as a warning. The result returned is zero.
Units are consolidated across Multiply and Divide. The result is returned in the current units of the physical quantity of the result for example when current units of pressure are psi then:
If one value has no unit it is assumed to be a scaling factor. This also applies to reciprocal physical quantities. For example:
for (10 / XLEN) will return 2mm-1 when XLEN is 5mm
2 * 3 -> 6.0
2 / 3 -> 0.666666666
Divide by zero.

Synopsis
number * number
-> number
number / number
-> number
Description
Multiply or divide two numbers. They can also be used as unary operators at the beginning of a parenthesized sub-expression. Numeric underflow is not considered to be an error and neither is it flagged as a warning. The result returned is zero.
Side Effects
Units are consolidated across Multiply and Divide. The result is returned in the current units of the physical quantity of the result for example when current units of pressure are psi then:
q (20kgf/ 1 cm2 ) will return 284.47PSI
If one value has no unit it is assumed to be a scaling factor. This also applies to reciprocal physical quantities. For example:
for (10 / XLEN) will return 2mm-1 when XLEN is 5mm
Example
2 * 3 -> 6.0
2 / 3 -> 0.666666666
Errors
Divide by zero.

Synopsis
number * number
-> number
number / number
-> number
Description
Side Effects
(10 / XLEN)
Example
2 * 3 -> 6.0
2 / 3 -> 0.666666666
Errors


All referenced units are current units. The numeric functions available are:
ABS ( number1 )
Gives the absolute value of a number
ACOS ( number1 )
Gives the arc cosine of a number, in degrees.
ASIN ( number1 )
Gives the arc sine of a number, in degrees.
ATAN ( number1 )
Gives the arc tangent of a number, in degrees.
ATANT ( number1, number2 )

Gives the arc tangent of number1/number2, in degrees, with the appropriate sign.
ALOG ( number1 )
Gives the exponential function (natural anti-log) of a number.
ARRAY(pos or dir or ori)

Converts a position, direction or orientation value or attribute into three numbers.
ARRAYSIZE ( variable-name )

Gives the size of an array variable.
ARRAYWIDTH( variable-name )

Gives the largest display width of any string in array variable-name.
COMPONENT dir OF pos2
Gives the magnitude of a vector drawn from E0 N0 U0 to pos2, projected in the direction dir1.
INT ( number1 )
Gives the truncated integer value of a number.
SIN ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
COS ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
TAN ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
LENGTH ( text1 )
Gives the length of text1.
LOG ( number1 )
Gives the natural logarithm of a number.
MATCH ( text1, text2 )
Gives the position of the beginning of the leftmost occurrence of text2 in text1. If text2 does not occur in text1, 0 is returned.
MAX ( number1, number2[ , number3 [. . .]]) )

Gives the maximum value of the arguments.
MIN ( number1, number2[ , number3 [. . .]]) )

Gives the minimum value of the arguments.
NEGATE
Multiply a number by -1.0.
NINT ( number1 )
Gives the nearest integer to a real. NINT(N+0.5) is equal to N+1 if N is positive or equal to zero, to N if N is negative.
OCCUR ( text1, text2 )
Gives the number of times string text2 occurs in string text1.
REAL ( text1 )
Try to read a number at the beginning of text1.
POWER ( number1, number2 )

Gives the value of number1 raised to the power number2.
SQRT ( number1 )
Gives the square root of a number.
VVALUE ( variable-name )

Used for late evaluation of variables. Gives a real value.
ABS ( number1 )
-> number
Returns the absolute value of a real.
None.
ABS ( -3.2 ) -> 3.2
None.
All these will return values in current angle units.
ASIN ( number1 )
-> number
ACOS ( number1 )
-> number
ATAN ( number1 )
-> number
ATANT ( number1, number2 )
-> number
Return the arc-cosine, arc-sine or arc-tangent of a number, in degrees.
ATANT returns the arc-tangent of number1/number2 with the appropriate sign. ATANT is useful where the second value is near or equal to zero.
For example, (6 0 ATANT) will give the correct result of 90 degrees, but (6 0 D ATAN) will indicate an error when trying to divide by zero.
None.
ACOS ( 0.8660254 ) -> 30degrees
Argument of ACOS or ASIN out of range [-1.0,+1.0]
ATANT (0.0,0.0) is undefined.
ALOG ( number1 )
-> number
Return the exponential function (natural anti-log) of a number.
Numeric underflow causes the result to be set to zero.
ALOG( -0.7 ) -> 0.4965853
Floating point overflow.
ARRAY(pos or dir or ori)
-> number
Converts a position, direction or orientation value or attribute into three numbers.
None
ARRAY(e100 ) -> 100 0 0
None.
ARRAYSize ( variable-name )
-> number
Give the size of an array variable.
If the array variable does not exist, the result is undefined.
ARRAYSIZE(!array) -> 2.0
The variable is a scalar variable and not an array variable.
The variable is an array variable element and not an array variable.
ARRAYWIDTH ( variable-name )
-> number
Give the largest display with of any string in array variable_name.
None.
If an array contains the following values:
!ARRAY[1] ’Bread’
!ARRAY[2] ’is’
!ARRAY[3] ’for’
!ARRAY[4] ’life,’
!ARRAY[5] ’not’
!ARRAY[6] ’just’
!ARRAY[7] ’for’
!ARRAY[8] ’breakfast’
Then
ARRAYWIDTH(!ARRAY -> 9
defines the length of ’breakfast’.

The variable is a scalar variable and not an array variable.
The variable is an array variable element and not an array variable.
COMPonent dir1 OF pos2
-> text
Returns the magnitude of a vector drawn from E0 N0 U0 to pos2, projected in the direction dir1.
None.
COMP E 45 N of N 0 E 100 U 50 -> 70.710
None.
DISTConvert ( number )
-> number
Returns a distance value cast from the input number.
The input value is converted to its database units (if it is a physical quantity) and then cast to database units of distance (i.e. mm) and presented in current units of distance.
None.
When current distance units are mm
distc(1000)
distc(10metre)
distc( 5pascal)
distc (5atm)

-> 1000mm
-> 10000mm
-> 5mm
-> 506625mm
When current distance units are inch
distc(1000)
distc(10metre)
distc( 5pascal)
distc (5atm)

-> 39.4in
-> 393.7in
-> 0.2in
-> 19945.9in
None.
All these will accept values qualified by angle units. If no unit is supplied the value is assumed to be in current angle units (usually degrees).
SINe ( number1 )
-> number
COSine ( number1 )
-> number
TANgent ( number1 )
-> number
Return the sine, cosine or tangent value of a number (considered to be in degrees).
None.
COS ( 0.0 ) returns 1.0
TAN ( 45.0 degrees ) returns 1.0
TAN (0.785 radians) ) returns 0.9992
Division by zero for TAN if the sine is (nearly) equal to zero.
INT ( number1 )
-> number
Return the truncated integer value of a number.
None.
INT ( -23.7 ) -> -23.0
Integer overflow.
LENgth ( text1 )
-> number
Return the length of text1.
None.
LENGTH ( ’abcdef’ ) -> 6.0
LENGTH ( ’’ ) -> 0.0
None.
LOG ( number1 )
-> number
Return the natural logarithm of a number.
None.
LOG( 3 ) -> 1 0986123
Negative arguments.
MATch ( text1 , text2)
-> number
Return the position of the beginning of the leftmost occurrence of text2 in text1. If text2 does not occur in text1, 0 is returned.
None.
MATCH ( ’abcdef’ , ’cd’ ) -> 3.0
MATCH ( ’abcdef’ , ’x’ ) -> 0.0
MATCH ( ’abcdef’ , ’’ ) -> 1.0
None.
MAX ( number1 , number2 [ , number3 [ ... ] ] )
-> number
MIN ( number1 , number2 [ , number3 [ ... ] ] )
-> number
Return the maximum or minimum value of the arguments.
Values being evaluated are assumed to of a common physical quantity.
If no unit qualifiers are supplied they are simply numbers.
If a physical quantity is defined the result will be in current units of that quantity.
If unqualified numbers are mixed with unit values they are assumed to be in the current units of that physical quantity.
If quantities are in mixed units they are all compared in comparison to a standard unit.
If quantities are of different types of physical quantities a warning is issued and the numeric result compares the values in their database units.
Min and Max return a value with the same dimension as that of their arguments.
MAX ( 1 , 3.4 ) -> 3.4
MIN ( 7.6 , -12.33 , 2.3 ) -> -12.33
MIN (7.6ft, 12.33inch, 1000mm ) -> 12.3 in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1000 ) -> 1000in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1kg ) -> 2316.5 (database mm equivalent of 7.6ft)
None.
NEGate ( number1 )
-> number
Multiply a real by -1.0.
None.
NEG ( 1 ) -> -1.0
None.
NINT ( number1 )
-> number
Return the nearest integer to a real. NINT(N+0.5) is equal to N+1 if N is positive or equal to zero, to N if N is negative.
None.
NINT ( 1.1 ) -> 1.0
NINT ( -23.7 ) -> -24.0
NINT ( 1.5 ) -> 2.0
NINT ( -11.5 ) -> -12.0
Integer overflow.
OCCUR(text1, text2)
-> integer
Counts the number of times string text2 occurs in string text1
None.
OCCUR (’ABBACCBBBBBAB’, ’BB’) -> 3
OCCUR(’ZZZZZZZZZZZ’, ’A’) -> 0
None.
REAL ( text1 )
-> number
Try to read a real number at the beginning of text1.
Note that if text is in the form of an exponent, (-12E-1 in the third example), there must be no spaces in it.
Note: this function was formerly called NUMBER.
Numeric underflow causes the result to be set to zero.
If the text string contains units they are ignored and the value only is returned.
If the test string contains text that is NOT a valid unit it will generate an error.
If the text string is space separated from the number it is completely ignored.
REAL ( ’12.34’) -> 12.34
REAL ( ’ 7.23 E 3 meters’ ) -> 7.23
REAL ( ’ -12E-1 meters ’ ) -> -1.2
REAL (' 1200 fred ' ) -> 1200
REAL (' 1200fred ' ) -> returns an error
This will return the value of the number in the string IGNORING any unit qualifier. The unit qualifier must still be a valid unit qualifier. This is done so that output from $! And VAR ! commands can still be accepted by the REAL function.
Unable to convert the text into a real number.
POWer ( number1 , number2 )
-> real
Return the value of number1 raised to the power number2.
If the value being raised to a power is that of a physical quantity the result is also of a physical quantity.(in relevant current units).
If the resultant quantity is non physical (for example, by raising to a fractional power, or an extreme power, a warning is given and only the value of quantity is raised to the power.
If the power is a physical quantity this also gives a warning.
POWER ( -2 , 3 ) -> -8
POWER ( -2inch , 2 ) -> 4in2
POWER ( 2inch, 3.5 ) -> returns 11.314 with an error (i.e. 2**3.5)
Floating point overflow.
Zero first argument and non-positive second argument (effectively divide by zero).
Negative first argument and non-integer second argument.
SQrt ( number1 )
-> number
Return the square root of a real.
Units are consolidated across SQRT. The resultant value will be in current units of that quantity.
If the resultant quantity has no recognized physical dimension a warning is given and the value return will be a number relating to the input value in database units.
SQRT ( 4 ) -> 2.0
SQRT ( 4inch2 ) -> 2.0inch
sqrt ( 4inch3 ) -> a warning and 256.02 which is sqrt (4*25.4mm)
Negative argument.
VVALUE is used for the late evaluation of PML variables.
VVALue( variable_name )
-> number
VVALue( variable_name , number )
-> number
With one argument, returns value of the scalar variable or value of the array variable element as a number.
With two arguments, returns value of the element corresponding to the index number as a number.
The value of the variable will be returned, irrespective of its units.
This will return the value of the number in the string IGNORING any unit qualifier. The unit qualifier must still be a valid unit qualifier. This is done so that output from $! And VAR ! commands can still be accepted by the VVAL function.
If the scalar variable, the array variable or the array variable element does not exist, the result is undefined.
VVAL ( !array[1] ) -> 1.0
VVAL ( !array , 2 ) -> 0.0
Scalar variable may not be indexed. For example, VTEXT (!var[1]) ) will return an error.
Array variable must have an index. For example, VTEXT ( !array ) ) will return an error.
The string can not be converted to a number.

Function
Comments
ABS ( number1 )
Gives the absolute value of a number
ACOS ( number1 )
Gives the arc cosine of a number, in degrees.
ASIN ( number1 )
Gives the arc sine of a number, in degrees.
ATAN ( number1 )
Gives the arc tangent of a number, in degrees.
ATANT ( number1, number2 )
Gives the arc tangent of number1/number2, in degrees, with the appropriate sign.
ALOG ( number1 )
Gives the exponential function (natural anti-log) of a number.
ARRAY(pos or dir or ori)
Converts a position, direction or orientation value or attribute into three numbers.
ARRAYSIZE ( variable-name )
Gives the size of an array variable.
ARRAYWIDTH( variable-name )
Gives the largest display width of any string in array variable-name.
COMPONENT dir OF pos2
Gives the magnitude of a vector drawn from E0 N0 U0 to pos2, projected in the direction dir1.
INT ( number1 )
Gives the truncated integer value of a number.
SIN ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
COS ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
TAN ( number1 )
Gives the sine, cosine or tangent value of a number (considered to be in current units of angle (degrees) if value is unqualified).
LENGTH ( text1 )
Gives the length of text1.
LOG ( number1 )
Gives the natural logarithm of a number.
MATCH ( text1, text2 )
Gives the position of the beginning of the leftmost occurrence of text2 in text1. If text2 does not occur in text1, 0 is returned.
MAX ( number1, number2[ , number3 [. . .]]) )
Gives the maximum value of the arguments.
MIN ( number1, number2[ , number3 [. . .]]) )
Gives the minimum value of the arguments.
NEGATE
Multiply a number by -1.0.
NINT ( number1 )
Gives the nearest integer to a real. NINT(N+0.5) is equal to N+1 if N is positive or equal to zero, to N if N is negative.
OCCUR ( text1, text2 )
Gives the number of times string text2 occurs in string text1.
REAL ( text1 )
Try to read a number at the beginning of text1.
POWER ( number1, number2 )
Gives the value of number1 raised to the power number2.
SQRT ( number1 )
Gives the square root of a number.
VVALUE ( variable-name )
Used for late evaluation of variables. Gives a real value.
Synopsis
ABS ( number1 )
-> number
Description
Returns the absolute value of a real.
Side Effects
None.
Example
ABS ( -3.2 ) -> 3.2
Errors
None.
Synopsis
ASIN ( number1 )
-> number
ACOS ( number1 )
-> number
ATAN ( number1 )
-> number
ATANT ( number1, number2 )
-> number
Description
Return the arc-cosine, arc-sine or arc-tangent of a number, in degrees.
ATANT returns the arc-tangent of number1/number2 with the appropriate sign. ATANT is useful where the second value is near or equal to zero.
For example, (6 0 ATANT) will give the correct result of 90 degrees, but (6 0 D ATAN) will indicate an error when trying to divide by zero.
Side Effects
None.
Example
ACOS ( 0.8660254 ) -> 30degrees
Errors
Argument of ACOS or ASIN out of range [-1.0,+1.0]
ATANT (0.0,0.0) is undefined.
Synopsis
ALOG ( number1 )
-> number
Description
Return the exponential function (natural anti-log) of a number.
Side Effects
Numeric underflow causes the result to be set to zero.
Example
ALOG( -0.7 ) -> 0.4965853
Errors
Floating point overflow.
Synopsis
ARRAY(pos or dir or ori)
-> number
Description
Converts a position, direction or orientation value or attribute into three numbers.
Side Effects
None
Example
ARRAY(e100 ) -> 100 0 0
Errors
None.
Synopsis
ARRAYSize ( variable-name )
-> number
Description
Give the size of an array variable.
Side Effects
If the array variable does not exist, the result is undefined.
Example
ARRAYSIZE(!array) -> 2.0
Errors
The variable is a scalar variable and not an array variable.
The variable is an array variable element and not an array variable.
Synopsis
ARRAYWIDTH ( variable-name )
-> number
Description
Give the largest display with of any string in array variable_name.
Side Effects
None.
Example
If an array contains the following values:
!ARRAY[1] ’Bread’
!ARRAY[2] ’is’
!ARRAY[3] ’for’
!ARRAY[4] ’life,’
!ARRAY[5] ’not’
!ARRAY[6] ’just’
!ARRAY[7] ’for’
!ARRAY[8] ’breakfast’
Then
ARRAYWIDTH(!ARRAY -> 9
defines the length of ’breakfast’.
Errors
The variable is a scalar variable and not an array variable.
The variable is an array variable element and not an array variable.
Synopsis
COMPonent dir1 OF pos2
-> text
Description
Returns the magnitude of a vector drawn from E0 N0 U0 to pos2, projected in the direction dir1.
Side Effects
None.
Example
COMP E 45 N of N 0 E 100 U 50 -> 70.710
Errors
None.
Synopsis
DISTConvert ( number )
-> number
Description
Returns a distance value cast from the input number.
The input value is converted to its database units (if it is a physical quantity) and then cast to database units of distance (i.e. mm) and presented in current units of distance.
Side Effects
None.
Example
When current distance units are mm
distc(1000)
distc(10metre)
distc( 5pascal)
distc (5atm)
-> 1000mm
-> 10000mm
-> 5mm
-> 506625mm
When current distance units are inch
distc(1000)
distc(10metre)
distc( 5pascal)
distc (5atm)
-> 39.4in
-> 393.7in
-> 0.2in
-> 19945.9in
Errors
None.
Synopsis
SINe ( number1 )
-> number
COSine ( number1 )
-> number
TANgent ( number1 )
-> number
Description
Return the sine, cosine or tangent value of a number (considered to be in degrees).
Side Effects
None.
Example
COS ( 0.0 ) returns 1.0
TAN ( 45.0 degrees ) returns 1.0
TAN (0.785 radians) ) returns 0.9992
Errors
Division by zero for TAN if the sine is (nearly) equal to zero.
Synopsis
INT ( number1 )
-> number
Description
Return the truncated integer value of a number.
Side Effects
None.
Example
INT ( 1.6 )    -> 1.0
INT ( -23.7 ) -> -23.0
Errors
Integer overflow.
Synopsis
LENgth ( text1 )
-> number
Description
Return the length of text1.
Side Effects
None.
Example
LENGTH ( ’abcdef’ ) -> 6.0
LENGTH ( ’’ ) -> 0.0
Errors
None.
Synopsis
LOG ( number1 )
-> number
Description
Return the natural logarithm of a number.
Side Effects
None.
Example
LOG( 3 ) -> 1 0986123
Errors
Negative arguments.
Synopsis
MATch ( text1 , text2)
-> number
Description
Return the position of the beginning of the leftmost occurrence of text2 in text1. If text2 does not occur in text1, 0 is returned.
Side Effects
None.
Example
MATCH ( ’abcdef’ , ’cd’ ) -> 3.0
MATCH ( ’abcdef’ , ’x’ ) -> 0.0
MATCH ( ’abcdef’ , ’’ ) -> 1.0
Errors
None.
Synopsis
MAX ( number1 , number2 [ , number3 [ ... ] ] )
-> number
MIN ( number1 , number2 [ , number3 [ ... ] ] )
-> number
Description
Return the maximum or minimum value of the arguments.
Side Effects
Values being evaluated are assumed to of a common physical quantity.
If no unit qualifiers are supplied they are simply numbers.
If a physical quantity is defined the result will be in current units of that quantity.
If unqualified numbers are mixed with unit values they are assumed to be in the current units of that physical quantity.
If quantities are in mixed units they are all compared in comparison to a standard unit.
If quantities are of different types of physical quantities a warning is issued and the numeric result compares the values in their database units.
Min and Max return a value with the same dimension as that of their arguments.
Example
MAX ( 1 , 3.4 ) -> 3.4
MIN ( 7.6 , -12.33 , 2.3 ) -> -12.33
MIN (7.6ft, 12.33inch, 1000mm ) -> 12.3 in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1000 ) -> 1000in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1kg ) -> 2316.5 (database mm equivalent of 7.6ft)
Errors
None.
Synopsis
NEGate ( number1 )
-> number
Description
Multiply a real by -1.0.
Side Effects
None.
Example
NEG ( 1 ) -> -1.0
Errors
None.
Synopsis
NINT ( number1 )
-> number
Description
Return the nearest integer to a real. NINT(N+0.5) is equal to N+1 if N is positive or equal to zero, to N if N is negative.
Side Effects
None.
Example
NINT ( 1.1 ) -> 1.0
NINT ( -23.7 ) -> -24.0
NINT ( 1.5 ) -> 2.0
NINT ( -11.5 ) -> -12.0
Errors
Integer overflow.
Synopsis
OCCUR(text1, text2)
-> integer
Description
Counts the number of times string text2 occurs in string text1
Side Effects
None.
Example
OCCUR (’ABBACCBBBBBAB’, ’BB’) -> 3
OCCUR(’ZZZZZZZZZZZ’, ’A’) -> 0
Errors
None.
Synopsis
REAL ( text1 )
-> number
Description
Try to read a real number at the beginning of text1.
Note that if text is in the form of an exponent, (-12E-1 in the third example), there must be no spaces in it.
Note: this function was formerly called NUMBER.
Side Effects
Numeric underflow causes the result to be set to zero.
If the text string contains units they are ignored and the value only is returned.
If the test string contains text that is NOT a valid unit it will generate an error.
If the text string is space separated from the number it is completely ignored.
Example
REAL ( ’12.34’) -> 12.34
REAL ( ’ 7.23 E 3 meters’ ) -> 7.23
REAL ( ’ -12E-1 meters ’ ) -> -1.2
REAL (' 1200 fred ' ) -> 1200
REAL (' 1200fred ' ) -> returns an error
This will return the value of the number in the string IGNORING any unit qualifier. The unit qualifier must still be a valid unit qualifier. This is done so that output from $! And VAR ! commands can still be accepted by the REAL function.
Note:
The extension of these functions are NOT supported in DARS as they require PML functionality.
Errors
Unable to convert the text into a real number.
Synopsis
POWer ( number1 , number2 )
-> real
Description
Return the value of number1 raised to the power number2.
Side Effects
If the value being raised to a power is that of a physical quantity the result is also of a physical quantity.(in relevant current units).
If the resultant quantity is non physical (for example, by raising to a fractional power, or an extreme power, a warning is given and only the value of quantity is raised to the power.
If the power is a physical quantity this also gives a warning.
Example
POWER ( -2 , 3 ) -> -8
POWER ( -2inch , 2 ) -> 4in2
POWER ( 2inch, 3.5 ) -> returns 11.314 with an error (i.e. 2**3.5)
Errors
Floating point overflow.
Zero first argument and non-positive second argument (effectively divide by zero).
Negative first argument and non-integer second argument.
Synopsis
SQrt ( number1 )
-> number
Description
Return the square root of a real.
Side Effects
Units are consolidated across SQRT. The resultant value will be in current units of that quantity.
If the resultant quantity has no recognized physical dimension a warning is given and the value return will be a number relating to the input value in database units.
Example
SQRT ( 4 ) -> 2.0
SQRT ( 4inch2 ) -> 2.0inch
sqrt ( 4inch3 ) -> a warning and 256.02 which is sqrt (4*25.4mm)
Errors
Negative argument.
Synopsis
VVALue( variable_name )
-> number
VVALue( variable_name , number )
-> number
Description
With one argument, returns value of the scalar variable or value of the array variable element as a number.
With two arguments, returns value of the element corresponding to the index number as a number.
The value of the variable will be returned, irrespective of its units.
This will return the value of the number in the string IGNORING any unit qualifier. The unit qualifier must still be a valid unit qualifier. This is done so that output from $! And VAR ! commands can still be accepted by the VVAL function.
Note:
The extension of these functions are NOT supported in DARS as they require PML functionality.
Side Effects
If the scalar variable, the array variable or the array variable element does not exist, the result is undefined.
Example
VVAL ( !array[1] ) -> 1.0
VVAL ( !array , 2 ) -> 0.0
Errors
Scalar variable may not be indexed. For example, VTEXT (!var[1]) ) will return an error.
Array variable must have an index. For example, VTEXT ( !array ) ) will return an error.
The string can not be converted to a number.
Note:
The extension of these functions are NOT supported in DARS as they require PML functionality.
Note:
The extension of these functions are NOT supported in DARS as they require PML functionality.

Function
Comments
ABS ( number1 )
ACOS ( number1 )
ASIN ( number1 )
ATAN ( number1 )
ATANT ( number1, number2 )
number1
number2
ALOG ( number1 )
ARRAY(pos or dir or ori)
ARRAYSIZE ( variable-name )
ARRAYWIDTH( variable-name )
COMPONENT dir OF pos2
pos2
dir1
INT ( number1 )
SIN ( number1 )
COS ( number1 )
TAN ( number1 )
LENGTH ( text1 )
LOG ( number1 )
MATCH ( text1, text2 )
text2
text1
text2
text1
MAX ( number1, number2[ , number3 [. . .]]) )
MIN ( number1, number2[ , number3 [. . .]]) )
NEGATE
NINT ( number1 )
OCCUR ( text1, text2 )
text2
text1
REAL ( text1 )
text1
POWER ( number1, number2 )
number1
number2
SQRT ( number1 )
VVALUE ( variable-name )
Synopsis
ABS ( number1 )
-> number
Description
Side Effects
Example
ABS ( -3.2 ) -> 3.2
Errors
Synopsis
ASIN ( number1 )
-> number
ACOS ( number1 )
-> number
ATAN ( number1 )
-> number
ATANT ( number1, number2 )
-> number
Description
number1/number2
Side Effects
Example
ACOS ( 0.8660254 ) -> 30degrees
Errors
ATANT (0.0,0.0)
Synopsis
ALOG ( number1 )
-> number
Description
Side Effects
Example
ALOG( -0.7 ) -> 0.4965853
Errors
Synopsis
ARRAY(pos or dir or ori)
-> number
Description
Side Effects
Example
ARRAY(e100 ) -> 100 0 0
Errors
Synopsis
ARRAYSize ( variable-name )
-> number
Description
Side Effects
Example
Errors
Synopsis
ARRAYWIDTH ( variable-name )
-> number
Description
variable_name
Side Effects
Example
If an array contains the following values:
!ARRAY[1] ’Bread’
!ARRAY[2] ’is’
!ARRAY[3] ’for’
!ARRAY[4] ’life,’
!ARRAY[5] ’not’
!ARRAY[6] ’just’
!ARRAY[7] ’for’
!ARRAY[8] ’breakfast’
ARRAYWIDTH(!ARRAY -> 9
Errors
Synopsis
COMPonent dir1 OF pos2
-> text
Description
pos2
dir1.
Side Effects
Example
COMP E 45 N of N 0 E 100 U 50 -> 70.710
Errors
Synopsis
DISTConvert ( number )
-> number
Description
Side Effects
Example
-> 1000mm
-> 10000mm
-> 5mm
-> 506625mm
distc(1000)
distc(10metre)
distc( 5pascal)
distc (5atm)
-> 39.4in
-> 393.7in
-> 0.2in
-> 19945.9in
Errors
Synopsis
SINe ( number1 )
-> number
COSine ( number1 )
-> number
TANgent ( number1 )
-> number
Description
Side Effects
Example
COS ( 0.0 ) returns 1.0
TAN ( 45.0 degrees ) returns 1.0
TAN (0.785 radians) ) returns 0.9992
Errors
Synopsis
INT ( number1 )
-> number
Description
Side Effects
Example
Errors
Synopsis
LENgth ( text1 )
-> number
Description
text1
Side Effects
Example
LENGTH ( ’abcdef’ ) -> 6.0
LENGTH ( ’’ ) -> 0.0
Errors
Synopsis
LOG ( number1 )
-> number
Description
Side Effects
Example
LOG( 3 ) -> 1 0986123
Errors
Synopsis
MATch ( text1 , text2)
-> number
Description
text2
text1
text2
text1
Side Effects
Example
MATCH ( ’abcdef’ , ’cd’ ) -> 3.0
MATCH ( ’abcdef’ , ’x’ ) -> 0.0
MATCH ( ’abcdef’ , ’’ ) -> 1.0
Errors
Synopsis
MAX ( number1 , number2 [ , number3 [ ... ] ] )
-> number
MIN ( number1 , number2 [ , number3 [ ... ] ] )
-> number
Description
Side Effects
Example
MAX ( 1 , 3.4 ) -> 3.4
MIN ( 7.6 , -12.33 , 2.3 ) -> -12.33
MIN (7.6ft, 12.33inch, 1000mm ) -> 12.3 in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1000 ) -> 1000in (current distance units are inch)
MAX (7.6ft, 12.33inch, 1kg ) -> 2316.5 (database mm equivalent of 7.6ft)
Synopsis
NEGate ( number1 )
-> number
Description
Side Effects
Example
NEG ( 1 ) -> -1.0
Errors
Synopsis
Description
NINT(N+0.5)
N+1
N
N
N
Side Effects
Example
NINT ( 1.1 ) -> 1.0
NINT ( -23.7 ) -> -24.0
NINT ( 1.5 ) -> 2.0
NINT ( -11.5 ) -> -12.0
Errors
Synopsis
OCCUR(text1, text2)
-> integer
Description
text2
text1
Side Effects
Example
OCCUR (’ABBACCBBBBBAB’, ’BB’) -> 3
OCCUR(’ZZZZZZZZZZZ’, ’A’) -> 0
Errors
Synopsis
REAL ( text1 )
-> number
Description
text1
Side Effects
Example
REAL ( ’12.34’) -> 12.34
REAL ( ’ 7.23 E 3 meters’ ) -> 7.23
REAL ( ’ -12E-1 meters ’ ) -> -1.2
REAL (' 1200 fred ' ) -> 1200
REAL (' 1200fred ' ) -> returns a
Note
:
Errors
Synopsis
POWer ( number1 , number2 )
-> real
Description
number1
number2
Side Effects
Example
POWER ( -2 , 3 ) -> -8
POWER ( -2inch , 2 ) -> 4in2
POWER ( 2inch, 3.5 ) -> returns 11.314 with an error (i.e. 2**3.5)
Errors
Synopsis
SQrt ( number1 )
-> number
Description
Side Effects
Example
SQRT ( 4 ) -> 2.0
SQRT ( 4inch2 ) -> 2.0inch
sqrt ( 4inch3 ) -> a warning and 256.02 which is sqrt (4*25.4mm)
Errors
Synopsis
VVALue( variable_name )
-> number
VVALue( variable_name , number )
-> number
Description
Note
:
Side Effects
Example
VVAL ( !array[1] ) -> 1.0
VVAL ( !array , 2 ) -> 0.0
Errors
VTEXT (!var[1]) )
VTEXT ( !array ) )


Real array expressions can contain attributes of type real array, for example: DESP.


In real expressions the dimension of the result is tracked using:
If at any time a value with no dimension occurs where a value with a specific dimension is needed then the value is taken to be one of that dimension in the current working units of that dimension (for example, mm for distances, degrees for angles). This will occur in addition and subtraction operations, and arguments for typed functions (for example,. trigonometric).
Whenever a clash of physical quantity occurs then either a warning or an error will be raised (for example, SIN(25inch).
In all expressions and functions physical quantities are tracked and the result, wherever possible is returned in the current units of the resultant physical quantity (dimension). If the system cannot do this (for example, the expression is not dimensionally sound, or the dimension exceeds the scope which the system can track) then a warning is issued and a simple numeric result is returned.
When a user enters a literal value then the type of physical quantity is not known and the decision as to what it is determined to make it consistent with the context with respect to other values in the expression. When it is finally determined the value is then taken to be in the current units of that quantity. The method of this determination is normally straightforward and is described in specific sections above.
The units for PML variables are also unknown. Where units are known and handled similarly in expression.
To cope with ’unknown’ units each value remembers its original units internally. An attempt is then made to allow for ’unknown’ units across operators and within functions. In general the physical quantity of the result of a function, or expressions, is tracked by the system and the resulting value is one of the resultant physical quantities. For example multiplying 3 distances together gives a result of a volume which will have units such as gallons, litres or cubic ft.
On comparison, addition or subtraction of two values then if one has units and the other has none (i.e. not a physical quantity) it is assumed to be the same sort of quantity as the other, and in the current units of that quantity.
For example:
If we are working in distance units of inches, it is known that XLEN is a distance value. Internally the value is held in mm, but the units are held as INCH. The units for ’10’ are held as unknown. On doing the comparison, the ’10’ is assumed to be inches and thus multiplied by 25.4 to make sure that the comparison works as expected.
Special action is also taken to preserve the correct units across multiplication, division, POWER and SQRT, as described in the sections above.
(XLEN GT 10).
The dimension of any attribute values used (for example, XLEN, BANG, DENS, GVOL)
The unit qualifiers of any values supplied
The known result of any function (for example, ASIN returns an angle, POW, SQRT return a computed dimension, MIN/MAX that of their arguments etc.)
The computed result of multiplication and division operation. (for example, GWEI/GVOL is a density)
The need for consistency for addition and subtraction operations
The dimension of any attribute values used (for example, XLEN, BANG, DENS, GVOL)
The dimension of any attribute values used (for example, XLEN, BANG, DENS, GVOL)
The unit qualifiers of any values supplied
The unit qualifiers of any values supplied
The known result of any function (for example, ASIN returns an angle, POW, SQRT return a computed dimension, MIN/MAX that of their arguments etc.)
The known result of any function (for example, ASIN returns an angle, POW, SQRT return a computed dimension, MIN/MAX that of their arguments etc.)
The computed result of multiplication and division operation. (for example, GWEI/GVOL is a density)
The computed result of multiplication and division operation. (for example, GWEI/GVOL is a density)
The need for consistency for addition and subtraction operations
The need for consistency for addition and subtraction operations


IDs can be used in expressions. IDs can be any of the following:
SPEC OF SPREF OF FLAN 1 OF NEXT BRAN.
HEAD TUBE OF /BRAN1.
Element name, for example: /VESS1.
Refno, for example: =23/456.
Element type further up the hierarchy, for example: SITE.
Number within member list, for example: 3.
Type and number within member list, for example: BOX 3.
NEXT, PREV for next, previous within current list. Optionally with a count and/or element type, for example: NEXT 2 BOX, LAST CYL.
NEXT, PREV MEMBER for next, previous within member list. Optionally with a count and/or element type.
If the element type given is only valid as a member then MEMBER is assumed. For example, NEXT BOX at an EQUIPMENT will assume MEMBER.
FIRST, LAST for first and last in current list. Optionally with a count and/or element type.
FIRST, LAST MEMBER for first and last in member list. If the element type given is only valid as a member then MEMBER is assumed.
END to navigate up from current list.
END is similar to owner but not quite the same. For example, if the current element is a GROUP MEMBER, and it has been reached from the GROUP then END will return to the group but OWNE will go to the true owner.
Attribute of type ref, for example: CREF
SAME to mean last current element
NULREF to mean =0/0
CE for the current element
’OF’ may be used to nest the options indefinitely. For example:
SPEC OF SPREF OF FLAN 1 OF NEXT BRAN.
This denotes the SPEC element owing the SELE element pointed to by the SPREF attribute on the first FLANGE of the next BRANCH. ILEAVE TUBE, IARRIV TUBE, HEAD TUBE, TAIL TUBE can be added to denote tube. For example:
HEAD TUBE OF /BRAN1.
An error will occur if there is no implied tube for the element concerned.
ID arrays can also be used in expressions. For example, CRFA.
Element name, for example: /VESS1.
Element name, for example: /VESS1.
Refno, for example: =23/456.
Refno, for example: =23/456.
Element type further up the hierarchy, for example: SITE.
Element type further up the hierarchy, for example: SITE.
Number within member list, for example: 3.
Number within member list, for example: 3.
Type and number within member list, for example: BOX 3.
Type and number within member list, for example: BOX 3.
NEXT, PREV for next, previous within current list. Optionally with a count and/or element type, for example: NEXT 2 BOX, LAST CYL.
NEXT, PREV for next, previous within current list. Optionally with a count and/or element type, for example: NEXT 2 BOX, LAST CYL.
NEXT, PREV MEMBER for next, previous within member list. Optionally with a count and/or element type.
NEXT, PREV MEMBER for next, previous within member list. Optionally with a count and/or element type.
If the element type given is only valid as a member then MEMBER is assumed. For example, NEXT BOX at an EQUIPMENT will assume MEMBER.
If the element type given is only valid as a member then MEMBER is assumed. For example, NEXT BOX at an EQUIPMENT will assume MEMBER.
FIRST, LAST for first and last in current list. Optionally with a count and/or element type.
FIRST, LAST for first and last in current list. Optionally with a count and/or element type.
FIRST, LAST MEMBER for first and last in member list. If the element type given is only valid as a member then MEMBER is assumed.
FIRST, LAST MEMBER for first and last in member list. If the element type given is only valid as a member then MEMBER is assumed.
END to navigate up from current list.
END to navigate up from current list.
END is similar to owner but not quite the same. For example, if the current element is a GROUP MEMBER, and it has been reached from the GROUP then END will return to the group but OWNE will go to the true owner.
END is similar to owner but not quite the same. For example, if the current element is a GROUP MEMBER, and it has been reached from the GROUP then END will return to the group but OWNE will go to the true owner.
Attribute of type ref, for example: CREF
Attribute of type ref, for example: CREF
SAME to mean last current element
SAME to mean last current element
NULREF to mean =0/0
NULREF to mean =0/0
CE for the current element
CE for the current element
’OF’ may be used to nest the options indefinitely. For example:
SPEC OF SPREF OF FLAN 1 OF NEXT BRAN.
’OF’ may be used to nest the options indefinitely. For example:
This denotes the SPEC element owing the SELE element pointed to by the SPREF attribute on the first FLANGE of the next BRANCH. ILEAVE TUBE, IARRIV TUBE, HEAD TUBE, TAIL TUBE can be added to denote tube. For example:
HEAD TUBE OF /BRAN1.
This denotes the SPEC element owing the SELE element pointed to by the SPREF attribute on the first FLANGE of the next BRANCH. ILEAVE TUBE, IARRIV TUBE, HEAD TUBE, TAIL TUBE can be added to denote tube. For example:
An error will occur if there is no implied tube for the element concerned.
ID arrays can also be used in expressions. For example, CRFA.
An error will occur if there is no implied tube for the element concerned.
Note:
Some of the ID syntax clashes with other types. To allow for this, an id expression may always be preceded with the keyword ID. For example, ID 3 will mean the third member of the current list rather than a number of value 3.

Note
:


The basic ways of defining a position are:
The Cartesian position may optionally be followed by WRT to specify the axis system. Refer to WRT.
POS OF /VESS1 WRT /* or P1 POS OF /CYL2
N 45 W 20000 U 1000
N 1000 FROM /ATEST.
N 1000 FROM P1 OF /BOX2.
N 1000 FROM POSS OF /SCTN1
N (DESP[1] + 10) E
Position attribute plus optional WRT. For example:
POS OF /VESS1 WRT /* or P1 POS OF /CYL2
Cartesian position. For example:
N 45 W 20000 U 1000
Cartesian position from an element. For example:
N 1000 FROM /ATEST.
Cartesian position from a ppoint. For example:
N 1000 FROM P1 OF /BOX2.
Cartesian position from an attribute. For example:
N 1000 FROM POSS OF /SCTN1
Any numeric value within a position may itself be an expression. For example: the following is a valid position expression
N (DESP[1] + 10) E
Position attribute plus optional WRT. For example:
POS OF /VESS1 WRT /* or P1 POS OF /CYL2
Position attribute plus optional WRT. For example:
Cartesian position. For example:
N 45 W 20000 U 1000
Cartesian position. For example:
Cartesian position from an element. For example:
N 1000 FROM /ATEST.
Cartesian position from an element. For example:
Cartesian position from a ppoint. For example:
N 1000 FROM P1 OF /BOX2.
Cartesian position from a ppoint. For example:
Cartesian position from an attribute. For example:
N 1000 FROM POSS OF /SCTN1
Cartesian position from an attribute. For example:
Any numeric value within a position may itself be an expression. For example: the following is a valid position expression
N (DESP[1] + 10) E
Any numeric value within a position may itself be an expression. For example: the following is a valid position expression

WRT
WRT


The WRT keyword is used to toggle between absolute and relative units.
When we specify an element (or attribute of an element) we are specifying an absolute point in world space. The point can be given in world space or some other axis. Normally the answer is required relative to the owner axis system and this is taken as the default. For example:
Q POS
$ will return the position of the current element
$ relatively to its owner.
Q POS OF /EQUIP1
$ will return the position of EQUIP1 relative to its
$ owner.
Q POS
$ will return the position of the current element
$ relatively to its owner.
Q POS OF /EQUIP1
$ will return the position of EQUIP1 relative to its
$ owner.
If we require the result in some other axis system then the WRT keyword is used. For example:
Q POS WRT /*
$.for the position in world coordinates.
Q POS WRT /*
$.for the position in world coordinates.
When we specify a Cartesian coordinate we are dealing with a relative position.
For example, ’N 10’ is meaningless until we specify the axis system, or default to an axis system.
Again we use WRT to do this, although it is important to note that in this case we are going from a relative position to an absolute position (in the previous example WRT was used to go from an absolute position to a relative one).
For example:
N 100 WRT /BOX1
$ specifies an absolute position in world space
$ which is N100 of /BOX1.
N 100 WRT /BOX1
$ specifies an absolute position in world space
$ which is N100 of /BOX1.
The default is that Cartesian coordinates are in the owning element’s axis system. This absolute position can be expressed in different coordinate systems: the default is again the owner’s axis system.
A SITE at (0,0,0)
With default (World) orientation
A ZONE at (100,0,0)
With default (World) orientation
An EQUIPMENT at (100,0,0)
With orientation ’N IS E
A BOX at (-100,0,0)
With default (World) orientation
The result of Q (N 100 WRT /BOX1), will depend on the current element.
World
(300,100,0), in World coordinates.
Site
(300,100,0) in World coordinates because the World is the owner of the current element.
Zone
(300,100,0) in World coordinates, because the Site is the owner of the current element, and the Site coordinates are the same as the World coordinates.
Equipment
(200,100,0), which is the position relative to its owner, the Zone.
Box
(100,100,0) which is the position relative to its owner, the Equipment.
WRT can be further qualified by FROM.
Q POS
$ will return the position of the current element
$ relatively to its owner.
Q POS OF /EQUIP1
$ will return the position of EQUIP1 relative to its
$ owner.
Q POS WRT /*
$.for the position in world coordinates.
N 100 WRT /BOX1
$ specifies an absolute position in world space
$ which is N100 of /BOX1.
Item
Comments
A SITE at (0,0,0)
With default (World) orientation
A ZONE at (100,0,0)
With default (World) orientation
An EQUIPMENT at (100,0,0)
With orientation ’N IS E
A BOX at (-100,0,0)
With default (World) orientation
Location
Result
World
(300,100,0), in World coordinates.
Site
(300,100,0) in World coordinates because the World is the owner of the current element.
Zone
(300,100,0) in World coordinates, because the Site is the owner of the current element, and the Site coordinates are the same as the World coordinates.
Equipment
(200,100,0), which is the position relative to its owner, the Zone.
Box
(100,100,0) which is the position relative to its owner, the Equipment.
Note:
The CONSTRUCT syntax uses the world as the default axis.

Q POS
Q POS OF /EQUIP1
Q POS WRT /*
N 100 WRT /BOX1
Note
:
Q (N 100 WRT /BOX1)


Two positions can be compared with EQ, NE, GT, LT, GE or LE. The pairs of coordinates are only compared in the coordinate axes for which the two positions are defined. A position attribute always has all three coordinates defined.
For positions entered by you, only those coordinates which are given by you are defined. For example:
’N10U3’
$ only the Y and Z coordinates are defined,
$ while the X coordinate remains undefined
’N10U3’
$ only the Y and Z coordinates are defined,
$ while the X coordinate remains undefined
For the EQ operator, all the pairs of defined coordinates should be equal. For NE, only one pair of defined coordinates need be different. For GT (LT,GE,LE), all the defined coordinates of the first position should be greater than (less than, greater than or equal to, less than or equal to) the defined coordinates of the second position. This means that GE is not the opposite of LT and LE is not the opposite of GT.
If no coordinate of the two positions are defined for a common axis (e.g. ’N10’ and ’W4D7’), the result of the comparison is undefined.
’POS EQ W1S2D3’
$ This evaluates to true only if POS of the current $ element is (-1,-2,-3).
’POS GT N10’ or ’N10 LE POS’
$ Only the second coordinate of POS is compared;
$ if it is greater than 10, then the result is true.
’E10N10 GT E0N0’
$ Is true because the inequality is verified for the X
$ and Y axis (both coordinates are undefined for
$ the Z axis, so it is ignored).
’E10N0 GT E0N0’
$ Is false because the Y components are different $ axes.
’E10N0 GT E0U100’
$ Is true. Although no comparison can be
$ performed n either the Y or the Z axis, because
$ the components are not present in both position
$ constants, the comparison is true in the X
$ component.
’N10 EQ W4D7’
$ Is undefined (no comparison is possible).
’POS EQ W1S2D3’
$ This evaluates to true only if POS of the current $ element is (-1,-2,-3).
’POS GT N10’ or ’N10 LE POS’

$ Only the second coordinate of POS is compared;
$ if it is greater than 10, then the result is true.
’E10N10 GT E0N0’
$ Is true because the inequality is verified for the X
$ and Y axis (both coordinates are undefined for
$ the Z axis, so it is ignored).
’E10N0 GT E0N0’
$ Is false because the Y components are different $ axes.
’E10N0 GT E0U100’
$ Is true. Although no comparison can be
$ performed n either the Y or the Z axis, because
$ the components are not present in both position
$ constants, the comparison is true in the X
$ component.
’N10 EQ W4D7’
$ Is undefined (no comparison is possible).
Refer to Precision of Comparisons, for tolerances in comparing numbers.
’N10U3’
$ only the Y and Z coordinates are defined,
$ while the X coordinate remains undefined
’POS EQ W1S2D3’
$ This evaluates to true only if POS of the current $ element is (-1,-2,-3).
’POS GT N10’ or ’N10 LE POS’
$ Only the second coordinate of POS is compared;
$ if it is greater than 10, then the result is true.
’E10N10 GT E0N0’
$ Is true because the inequality is verified for the X
$ and Y axis (both coordinates are undefined for
$ the Z axis, so it is ignored).
’E10N0 GT E0N0’
$ Is false because the Y components are different $ axes.
’E10N0 GT E0U100’
$ Is true. Although no comparison can be
$ performed n either the Y or the Z axis, because
$ the components are not present in both position
$ constants, the comparison is true in the X
$ component.
’N10 EQ W4D7’
$ Is undefined (no comparison is possible).

Precision of Comparisons
’N10U3’
’POS EQ W1S2D3’
’POS GT N10’ or ’N10 LE POS’
’E10N10 GT E0N0’
’E10N0 GT E0N0’
’E10N0 GT E0U100’
’N10 EQ W4D7’
Precision of Comparisons
,


The POLAR keyword allows positions to be defined in terms of a distance in a particular direction from a point.
If FROM is not specified the default is the origin of the owner.
POLAR N 45 E DIST 20M FROM U 10 M
POLAR AXES PL OF PREV DIST ( ABORE * 10 ) FROM PL OF PRE V
POLAR N 45 E DIST 20M FROM U 10 M

POLAR AXES PL OF PREV DIST ( ABORE * 10 ) FROM PL OF PRE V

POLAR N 45 E DIST 20M FROM U 10 M
POLAR AXES PL OF PREV DIST ( ABORE * 10 ) FROM PL OF PRE V
POLAR dir DISTance expr -+- FROM -+- pos -----.
                         |        |           |
                         |        ‘- point ---|
                         |                    |
                         ‘--------------------+--->

POLAR dir DISTance expr -+- FROM -+- pos -----.
                         |        |           |
                         |        ‘- point ---|
                         |                    |
                         ‘--------------------+--->
POLAR N 45 E DIST 20M FROM U 10 M
POLAR AXES PL OF PREV DIST ( ABORE * 10 ) FROM PL OF PRE V


This reference manual describes in detail the structure and methods of the internal databases used within AVEVA E3D Design. It is written for System Administrators who may be involved in maintaining projects, and the databases from which they are created.


Information is provided on project organization, the definition of teams and multiple database and the splitting of data across multiple databases.


In order to create data, you must first create a Project.
A Project consists of:
A project starts with just the System, Comms and Misc DBs.
You will then have to create other DBs for users to work on. The various visible DB types are:
System
Contains details on DBs, Multiple Databases (MDBs), teams etc in the project
Dictionary
Contains User Defined Attribute (UDA) and User Defined Element Type (UDET) definitions
Property
Contains units for different properties
Catalog
Contains Catalog and specification information
Model
Contains Plant design information
Draw
Contains drawing information
SPOOL
Contains spool information
Materials
Contains hull material information
Diagrams
Contains Schematic information
Transaction
Used by Global to record transactions
SCHEMATIC
Contains PI&D (Schematic) information
MANU
Contains detailed manufacturing data
NSEQ
Stores name sequences
System
Contains details on DBs, Multiple Databases (MDBs), teams etc in the project
Dictionary
Contains User Defined Attribute (UDA) and User Defined Element Type (UDET) definitions
Property
Contains units for different properties
Catalog
Contains Catalog and specification information
Model
Contains Plant design information
Draw
Contains drawing information
SPOOL
Contains spool information
Materials
Contains hull material information
Diagrams
Contains Schematic information
Transaction
Used by Global to record transactions
SCHEMATIC
Contains PI&D (Schematic) information
MANU
Contains detailed manufacturing data
NSEQ
Stores name sequences
Typically there will be many DBs of each type within a project.
An example of a simple project is as follows:

DBs may be included from other projects.
Each DB has a unique DB number. User DBs have numbers in the range 1-7000. The range 7000-8000 is reserved for AVEVA supplied databases. The range 8000-8192 is reserved for system databases.
The DB number is assigned to the DB on creation. You may specify the DB number. If not specified by you then the next available DB number is used.
There may never be two DBs with the same DB number in a single project. Thus to include a DB from another project, that DB number must be unused in the target project.
System
Contains details on DBs, Multiple Databases (MDBs), teams etc in the project
Dictionary
Contains User Defined Attribute (UDA) and User Defined Element Type (UDET) definitions
Property
Contains units for different properties
Catalog
Contains Catalog and specification information
Model
Contains Plant design information
Draw
Contains drawing information
SPOOL
Contains spool information
Materials
Contains hull material information
Diagrams
Contains Schematic information
Transaction
Used by Global to record transactions
SCHEMATIC
Contains PI&D (Schematic) information
MANU
Contains detailed manufacturing data
NSEQ
Stores name sequences
One each of System, Comms, and Misc Databases (DBs)
Multiple Design, Catalog, Drawing, and Dictionary DBs
Various picture files
One each of System, Comms, and Misc Databases (DBs)
One each of System, Comms, and Misc Databases (DBs)
Multiple Design, Catalog, Drawing, and Dictionary DBs
Multiple Design, Catalog, Drawing, and Dictionary DBs
Various picture files
Various picture files

System
Dictionary
Property
Catalog
SPOOL
Materials
Diagrams
Transaction


For ease of working DBs are grouped into Teams and Multiple Databases (MDBs). A Database (DB) belongs to one team, but may be in many MDBs. You must specify the MDB to work on when entering AVEVA E3D Design.
Details of DBs, teams, and MDBs are stored in the system database.
An example is shown below.

It can be seen that DB /A is only in MDB /X, whereas DB /B is in both MDB /X and /Y.
Team access controls fundamental write access. Members of Team1 will always have write access to DBs /A and /B, and read access to the remainder. For members of Team2 it will be the opposite way around.
If a DB is included from another project then it is always read only regardless of team membership.
These concepts are discussed in detail in the Administrator User Guide.

Administrator User Guide
Administrator User Guide


Splitting Data Across Multiple Databases

Theoretically there need only be one Database (DB) of each DB type. The main reasons for there being more are:
DBs are used as a fundamental means of access control. DBs are allocated to Teams, and only team members can modify a DB.
Whilst the multiwrite facilities allow many writers per DB, it eases contention if the writers are not all accessing the same DB.
The easiest way to run a Global project is to have different DBs writable at different locations.
The granularity of propagation and distribution in Global is per DB
It allows different permutations of Multiple Databases (MDBs).
It allows specific DBs to be hidden from sub contractors
Inclusion in other projects is done on a DB basis.
DBs are used as a fundamental means of access control. DBs are allocated to Teams, and only team members can modify a DB.
DBs are used as a fundamental means of access control. DBs are allocated to Teams, and only team members can modify a DB.
Whilst the multiwrite facilities allow many writers per DB, it eases contention if the writers are not all accessing the same DB.
Whilst the multiwrite facilities allow many writers per DB, it eases contention if the writers are not all accessing the same DB.
The easiest way to run a Global project is to have different DBs writable at different locations.
The easiest way to run a Global project is to have different DBs writable at different locations.
The granularity of propagation and distribution in Global is per DB
The granularity of propagation and distribution in Global is per DB
It allows different permutations of Multiple Databases (MDBs).
It allows different permutations of Multiple Databases (MDBs).
It allows specific DBs to be hidden from sub contractors
It allows specific DBs to be hidden from sub contractors
Inclusion in other projects is done on a DB basis.
Inclusion in other projects is done on a DB basis.


All data in a Dabacon database is stored in elements. Every element has a type, for example BOX. The type of element determines the attributes available on the element.
Each DB type allows a different set of element types.
Database attributes are described in Database Attributes
The elements are organized in a primary hierarchy. This is described in Database hierarchy.

BOX
BOX


Every element has a reference number, which is assigned when the element is created, and is unique to that element within the project. The reference number comprises two 32 bit integers. This is displayed in the form:
The first integer encodes the database number. This can be queried on the command line using Q DBNUMBER.
The second integer is a sequence number, starting at 0, and incrementing each time an element is created.
Thus, for example, the element with a reference number of =8193/0 will be the WORLD element (since this is always created first) created in Database (DB) 1.
The reference number is never changed once an element has been created.


In AVEVA E3D Design any element may be given a name. The name always starts with a '/'. At the user level, it is this name that is typically used to identify an element. Names may of course be changed, thus there is no guarantee that the element named '/FRED' today is the same as the element named '/FRED' yesterday.
An element need not have a name. For these elements AVEVA E3D Design creates a constructed name, consisting of the relative position in the hierarchy up to the first named element.
for example, BOX 2 OF SUBEQUIPMENT 1 OF /VESS1
Whilst the constructed name can be used to identify elements, its use is even more volatile than named elements, since the order of an element in a member's list may change.
You can duplicate the name of an element in a Design (DESI), Production (MANU), Schematic (SCHE) or Engineering (ENGI) databases in the current MDB. For example an element can be named `/FRED´ in the DESI database and a different element can be named ´/FRED´ in the MANU database.
AVEVA E3D Design is case sensitive and AVEVA recommends you stick to UPPERCASE characters. If you create an element named /FRED and at some later time you try to find it by typing /fred or /FreD, it will not be found.


At the user level there is a concept of current element.
Most AVEVA E3D Design commands act on the current element. This is often referred to as the CE. There is an extensive set of commands to navigate around the database changing the CE.


For most elements, the element type may never be changed after creation. For example, once created, an element of type SITE will always be of type SITE until deleted.
There are a few exceptions to this rule where it makes sense. For example, BENDs may be changed to ELBOs and vice versa.


Information is provided on the hierarchical data model, the user defined hierarchies, the element instances and the use case of primary hierarchy.


Each database consists of a hierarchy of elements. The allowed hierarchy is defined in a Database Schema. The database schema is the 'meta data', i.e. it is data about data. Database Schemas cannot be modified by users. The Database Schema for each database type is listed in the data model reference manual. An example of part of the Database Schema for Model databases is shown below:

This schema shows which elements are allowed where. For example, a WORLD may own a SITE, or GROUPWORLD, whereas a SITE may own a ZONE, BOUNDARY, DRAWING or GROUND model.
The same element type may occur in more than one place in the schema. In the above example it can be seen that a BOUNDARY element may occur below a SITE or a ZONE.
All database schemas have a WORLD element at the root.


The database schemas in AVEVA E3D Design are fixed by AVEVA.
You may, however, customize the allowed hierarchy using User Defined Element Types (UDETs).
A UDET must be based on an existing system type. For example, you may define a UDET :PUMP which is based on an Equipment. By default, a UDET will have the same allowed members and allowed owners as a base type. This can be customised to be a subset of that allowed on the base type, for example, you might decide that SUBE are not allowed under a :PUMP even though they are allowed under an Equipment (EQUI).
UDETs based on zones may own other UDETs based on zones. This allows very flexible data models to be built.


A new database (DB) starts with a single world element with name '/*'. Users will then create instances of other element types. For example, a system user might create an initial hierarchy of sites and zones in a Model DB, leaving it to other users to create the actual Plant items.
An element instance will always be created within the primary hierarchy. For example, a new ZONE element must be created under an existing SITE. It cannot be created as a 'freestanding' element outside the existing hierarchy.
The actual element hierarchy can be viewed with the AVEVA E3D Design explorer.
All element instances within a multiple Database (MDB) are accessible at all times.


The primary hierarchy is used as follows:
It is used to create the 'constructed' name for unnamed elements.
When an element is deleted, all descendants in the primary hierarchy are deleted.
The COPY command will copy an element and all its primary descendants.
Claiming elements relies on the primary hierarchy.
Collections work on the primary hierarchy.
Most commands assume that the action is to be performed on the given element and its descendants in its primary hierarchy, for example,. adding a ZONE to a 3D view will add everything below that ZONE.
In the Design Database (DB), world positions and orientations are concatenated according to the primary hierarchy.
It is used to create the 'constructed' name for unnamed elements.
It is used to create the 'constructed' name for unnamed elements.
When an element is deleted, all descendants in the primary hierarchy are deleted.
When an element is deleted, all descendants in the primary hierarchy are deleted.
The COPY command will copy an element and all its primary descendants.
The COPY command will copy an element and all its primary descendants.
Claiming elements relies on the primary hierarchy.
Claiming elements relies on the primary hierarchy.
Collections work on the primary hierarchy.
Collections work on the primary hierarchy.
Most commands assume that the action is to be performed on the given element and its descendants in its primary hierarchy, for example,. adding a ZONE to a 3D view will add everything below that ZONE.
Most commands assume that the action is to be performed on the given element and its descendants in its primary hierarchy, for example,. adding a ZONE to a 3D view will add everything below that ZONE.
In the Design Database (DB), world positions and orientations are concatenated according to the primary hierarchy.
In the Design Database (DB), world positions and orientations are concatenated according to the primary hierarchy.


An element can only exist once in the primary data hierarchy. Secondary hierarchies, such as Group Sets (GPSETs), allow elements to appear more than once in the overall hierarchy. For example a PIPE will appear below a ZONE in the primary hierarchy. The same PIPE may also be added to a GPSET element. This is useful for collecting elements according to different criteria.
The diagram below shows a typical multi hierarchy where the secondary links are dotted.

Most commands will work on secondary hierarchies. For example, if /GPSET1 is added to a 3D view then this is equivalent to adding both /VESS1 and /PUMP2 to the 3D view. However, there are exceptions to this. In particular deleting a GROUP will not delete the GROUP members; thus deleting /GPSET1 will not delete /VESS1 and /PUMP2.
Unlike the Primary hierarchy, secondary hierarchies may span different databases (DBs).


Every element may have a number of attributes. All elements have the following attributes:
NAME
the element's name
TYPE
the element's type
LOCK
if set, then the element may not be modified
OWNER
the element's owner
MEMBERS
the current members of the element
NAME
the element's name
TYPE
the element's type
LOCK
if set, then the element may not be modified
OWNER
the element's owner
MEMBERS
the current members of the element
The remaining attributes vary depending on the element type. The Database Schema defines which attributes are available on an element type. The allowed attributes for an element type may be ascertained using Programmable Macro Language (PML) objects and other command queries.
Attributes may be one of the following types:
Ref
Ref Array
Position
Direction
Orientation
Attribute
ElementType (or Noun)
A 'Ref' type is a pointer to another element. For example, on a BRANCH element the Connection Reference (CREF) attribute points to the connected NOZZLE. The use of Ref attributes enables AVEVA E3D Design to model networks and other cross relationships.
The attribute type dictates how the attribute can be set with PML or specific syntax.
NAME
the element's name
TYPE
the element's type
LOCK
if set, then the element may not be modified
OWNER
the element's owner
MEMBERS
the current members of the element
Integer
Ref
Integer Array
Ref Array
Real
Position
Real Array
Direction
Bool (or Logical)
Orientation
Bool (or Logical) Array
Attribute
String (or Text)
ElementType (or Noun)

NAME
TYPE
LOCK
OWNER
MEMBERS


You can extend the allowed attributes for any element type, including a /ser Defined Element Type (UDET), by defining User Defined Attributes (UDAs). For example, you could define a UDA called :SUPPLIER of type string on all piping components. The newly defined UDA will then exist on all applicable elements, existing and new. If the definition of a UDA is changed then this will also apply to all existing instances.
Having defined a UDA, it is accessed in the same way as any other attribute.


In addition to the attributes stored on the database, there are a large number of pseudo attributes. The value of pseudo attributes is calculated at the time of making the query.
For example, the CUTLENGTH attribute on SCTN elements is a pseudo attribute calculated at the point of doing the query.
There is a lot of functionality presented via pseudo attributes. Currently there are over 1200 pseudo attributes.
Since the value of a pseudo attribute is calculated from other attributes, it is not generally possible to set their value directly.


Global Namespace for Attribute and Element Type Names

Attributes and element types have a global name space. This means that an attribute such as XLEN will have an identical meaning wherever it exists.
Similarly if an element type is valid in more than one database type, the definition of the element type will be identical in each.


Some real attributes are simply numbers, counts, quantities etc. Others represent real physical quantities such as distances, areas, densities, angles etc. The type of physical quantity is called its physical dimension, often shortened in unambiguous contexts to its dimension. Real attributes (stored, derived, user defined etc.) can all be assigned a physical dimension and this determines the type of data stored in these attributes wherever and whenever they occur in the database. The most common dimensions of attributes are of length (internally set to either DIST or BORE). There are many others supported including density, mass, pressure, temperature, area, volume and angle.
The dimension of an attribute is held in the database in its (ambiguously named) UNIT field. It may be queried directly using the VAR ATTDEF attributeName UNIT syntax, and the !attribute.units() PML ATTRIBUTE object method, refer to PML ElementType Class.

PML ElementType Class
PML ElementType Class


Information is provided on database expressions and rules to define a database.


Database expressions can be of the following types:
The contents of an expression may contain the standard operator and mathematical functions along with the names of attributes and element identification.
This expression simply multiplies the three attributes XLEN, YLEN, ZLEN together and then multiplies by two.
The attributes refer to the current element. If attributes of other elements are required then the OF syntax is used.
The 'OF' keyword makes sure that the AREA attribute is obtained from the owner of the current element rather than the current element itself.
The main uses of expressions are:
Database expressions are very similar to Programmable Macro Language (PML) expressions. The major difference is that database expressions may not contain other PML variables or functions. For example, (XLEN * !MYVAR) is not a valid database expression.
(XLEN * YLEN * ZLEN * 2)
(PURP EQ 'HS' AND AREA OF OWNER EQ 1)
algebraic
boolean (or logical)
text
Element ID
position
direction
orientation
algebraic
algebraic
boolean (or logical)
boolean (or logical)
text
text
Element ID
Element ID
position
position
direction
direction
orientation
orientation
Catalog parameterization
Template parameterization
Rules
Drafting line styles
User level collections and report
Catalog parameterization
Catalog parameterization
Template parameterization
Template parameterization
Rules
Rules
Drafting line styles
Drafting line styles
User level collections and report
User level collections and report


An attribute may be defined as a rule. For example, the attribute XLEN may be defined as a rule by the expression (YLEN * 2).
The OF syntax is often used in Rule expressions to refer to other elements, for example, (YLEN OF /FRED * 2)
The result of the rule is stored against the attribute as for other attributes.
There are commands to recalculate the rule.
Rules may be either static or dynamic. If static, then the rule result will only be recalculated on demand. If dynamic, then the result will be recalculated every time an attribute within the expression changes, for example, for the above rule, if YLEN is modified, then XLEN will be recalculated automatically. The dynamic linkage of rules may be across elements and across Databases (DBs).


Information is provided on the possibilities to dump out the database using data listings and the Reconfigurer.


Data listings (DATALs) capture the state of the database in the form of AVEVA E3D Design commands. All element data including all attributes, User Defined Attributes (UDAs) and rules will be captured. They are similar in concept to Extensible Markup Language (XML) output. These files can then be read back in via the command line.
Data listings are used as follows:
Long term archiving
Copying parts of a Database (DB) between projects
For general information.
Long term archiving
Long term archiving
Copying parts of a Database (DB) between projects
Copying parts of a Database (DB) between projects
For general information.
For general information.