Software Customisation
Reference Manual
PML 1 Expressions
:
Positions, Directions and Orientations in Expressions (AVEVA E3D™ only)
: Comparing Positions
Comparing Positions
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
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.
Examples
’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).
See also
Precision of Comparisons
,
for tolerances in comparing numbers.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.