|
*
|
Multiply
|
The multiplication operator (*) causes its two operands to be
multiplied.
|
|
/
|
Divide
|
The division operator (/) causes the first operand to be
divided by the second. If the first operand is less than zero and the second
operand is zero, the divide operator returns the value -3.402823466e+38. If the
first operand is greater than or equal to zero and the second operand is zero,
the divide operator returns the value +3.402823466e+38.
|
|
+
|
Add
|
The addition operator (+) causes its two operands to be added.
|
|
-
|
Subtract
|
The subtraction operator (-) causes the second operand to be
subtracted from the first.
|
|
? :
|
Conditional
|
The conditional operator is a ternary operator (it takes three
operands).
Result := Conditional-expression ? Expression :
Expression The first operand is evaluated and all side effects are
completed before continuing.
When the first operand evaluates to True (a nonzero value),
the second operand is evaluated.
When the first operand evaluates to False (0), the third
operand is evaluated.
For example, the expression alpha<beta ? delta : gamma;
(where alpha and beta are simple operands) means that if alpha is less than
beta, then evaluate delta; otherwise, evaluate gamma.
You many need to rearrange your operands to use the ?:
operator. For example, to write the conditional statement:
IF IN1 < 90 THEN
OUT1 := IN1;
ELSE
OUT1 := 90;ENDIF;
using the ?: operator, the statement is as follows:
OUT1 :=(IN1<90) ? IN1 : 90
Note
Always simplify the second and third operands when using
the ?: operator.
|
|
&
|
Bitwise AND
|
The AND (bit) operator compares each bit of its first operand
to the corresponding bit of its second operand. If both bits are 1, the
corresponding resultant bit is set to 1. Otherwise, the corresponding resultant
bit is set to 0.
|
|
AND
|
Logical AND
|
The logical AND operator produces the value 1 if both operands
are 1 (non-zero). If either operand is 0, the result is 0.
|
|
|
|
Bitwise OR
|
The inclusive OR (bit) operator compares each bit of its first
operand to the corresponding bit of its second operand. If either bit is 1, the
corresponding resultant bit is set to 1. Otherwise, the corresponding resultant
bit is set to 0.
|
|
OR
|
Logical OR
|
The logical OR operator performs an inclusive OR operation on
its operands. The result is 0 if both operands are 0. If either operand has a
non-zero value, the result is 1.
|
|
~
|
Bitwise NOT
|
The bitwise complement (or bitwise NOT) operator produces the
bitwise complement of its operand.
Note
This operator only works on signed values.
|
|
! or NOT
|
Logical NOT
|
The logical negation (logical NOT) operator sets the result to
0 if its operand is TRUE (non-zero). If its operand is False (0), the result is
1.
|
|
^
|
Bitwise Exclusive OR
|
The OR (bit) operator compares each bit of its first operand
to the corresponding bit of its second operand. If one bit is 0 and the other
bit is 1 (non-zero), the corresponding resultant bit is set to 1. Otherwise,
the corresponding resultant bit is set to 0.
In other DeltaV applications (such as DeltaV Operate), this
operator is defined differently. Refer to the application's definition when
writing expressions in other application's editors.
|
|
XOR
|
Logical Exclusive OR
|
The logical exclusive OR operator compares the first operand
to the second operand. If one operand is 0 and the other is 1 (non-zero), the
result is 1. Otherwise, the result is 0.
|
|
MOD or %
|
Modulus operator
|
MOD is the remainder of simple integer division. For example,
13 / 5 (13 divided by 5) is 2 with a remainder of 3. Therefore, 13 MOD 5 is 3.
When the division is inexact, the result is determined by the following rules:
- When the right
operand is zero, the result is zero.
- When both operands
are positive, the result is positive.
- When either
operand is negative and the result is inexact, the result is defined as
follows:
- In division
where either operand is negative, the direction of truncation is toward zero.
- When either
operation is negative in division with the remainder operator, the result has
the same sign as the dividend (the first operand in the expression). For
example -13 MOD 5 is -3, but 13 MOD -5 is 3.
|
|
=
|
Equality test
|
The first operand is equal to second operand.
|
|
>
|
Greater than
|
The first operand is greater than the second operand.
|
|
<
|
Less than
|
The first operand is less than the second operand.
|
|
>=
|
Greater than or equal to
|
The first operand is greater than or equal to second operand
|
|
<=
|
Less than or equal to
|
The first operand is less than or equal to second operand.
|
|
!= or <> or ~=
|
Does not equal
|
The first operand is not equal to the second operand.
Note
The ~= operator only works on signed values.
|
|
**
|
Raise to power
(Exponent)
|
The power operator computes the first operand raised to the
power of the second operand. If the first operand is negative and the second
operand is not an integer, the result is zero.
In other DeltaV applications (such as DeltaV Operate), this
operator is defined differently. Refer to the application's definition when
writing expressions in other application's editors.
|
|
:=
|
Assignment to output
|
The simple-assignment operator assigns its right operand to
its left operand.
|