StrictlyEqual
Description: | Will return TRUE if the parameter values are of the same type and also are equivalent, or if both are invalid. |
Returns: | Boolean |
Usage: | Script or steady state. |
Function Groups: | Variable |
Related to: | StrictlyNotEqual | IsEqual |
Format: | StrictlyEqual(Parm1, Parm2); |
Parameters: |
Parm1 |
Required. Any value, to be compared to parameter 2. |
Parm2 |
Required. Any value, to be compared to parameter 1. |
Comments: |
Will return either True or False. Will never return Invalid. |
X | Y | X == Y | X != Y | StrictlyEqual (X, Y) | StrictlyNotEqual (X, Y) |
Invalid | Invalid | Invalid | Invalid | TRUE | FALSE |
Invalid | 1 | Invalid | Invalid | FALSE | TRUE |
1 | Invalid | Invalid | Invalid | FALSE | TRUE |
1 | 1 | TRUE | FALSE | TRUE | FALSE |
\AS_1 | \AnalogStatus | FALSE | TRUE | FALSE | TRUE |
\AnalogStatus | \AS_1 | TRUE | FALSE | FALSE | TRUE |
2 | "2" | TRUE | FALSE | FALSE | TRUE |
"2" | 2 | TRUE | FALSE | FALSE | TRUE |
Note 1: AS_1 is an object; an instance of the module \AnalogStatus
Note 2: For text to number comparisons, VTScada will attempt to cast the number to text, then perform a case-sensitive comparison. The order of the operands does not matter.
Examples:
Increment NumberOneCount whenever a numeric 1 comes through, and TextOneCount whenever a text "1" comes through.
If Watch(1, Input); [ IfThen(StrictlyEqual(Input, 1), NumberOneCount++; ); IfThen(StrictlyEqual(Input, "1"), TextOneCount++; ); ]