Prefix operators
- Last UpdatedOct 04, 2024
- 1 minute read
- PI System
- PI Server 2023
- PI Server
A prefix operator is simply an operator that appears to the left of its operand, for example, .
|
Operator |
Meaning |
|---|---|
|
- |
Negation |
|
Not |
Complementation: Returns 1 if operand is 0 (or rounding to 0) and 0 otherwise |
The expression following a prefix operator should be numeric. If you use a tagname as the operand, make sure that the point returns a number. Note, too, that even points that typically return a number sometimes return a digital state, such as Shutdown. Valid examples include:
-3
Not 7
-TagVal ('sinusoid')
Not Cos('ba:level.1')
-StateNo('DigitalTag')
Not TagBad('StringTag'))
The last two examples use digital and string points (DigitalTag and StringTag) but these are used as arguments to functions that return numbers (StateNo and TagBad).