omron — Logical Operator NOT

Appendix: VBScript When multiplication and division occur together in an expression, each operation is evaluated as it occurs from left to right. Likewise, when addition and subtraction occur together in an expression, each operation is evaluated in order of appearance from left to right. The string concatenation (&) operator is not an arithmetic operator, but in precedence it falls after all arithmetic operators and before all comparison operators. The Is operator is an object reference comparison operator. It does not compare objects or their values; it checks only to determine if two object references refer to the same object.

Logical Operator NOT The logical operator NOT behaves differently in VBScript than it does in the built-in scripting language. NOT Operator in VBScript In VBScript, the NOT operator inverts the bits of a given numeric value, producing its complement number according to the "two's complement" system of signed numbers that is used by computers. The table below illustrates the behavior of the NOT operator in VBScript for the syntax… result = NOT expression Note: By default, when you attempt to write any numeric value other than 0 to a Boolean tag , the tag automatically assumes a value of 1.

Therefore, if VBScript's NOT operator is applied to a Boolean tag with a value of 1, then the value of the tag does not change; the operator returns a value of −2, but the tag cannot accept this value so it again assumes a value of 1. You can configure IWS to treat Boolean tags like Boolean variables in VBScript, so that the NOT operator in VBScript will work as expected. For more information, please see Boolean Tags and Boolean Variables . NOT Operator in Built-in Language In contrast, the NOT operator in the Built-in Scripting Language toggles the given numeric value as if it is a natural boolean.

The table below illustrates the behavior of the NOT operator in the Built-in Scripting Language for the syntax… result = NOT expression InduSoft Web Studio Page 669 Arithmetic Comparison Logical Multiplication and division (*, /) Less than ( Or Integer division (\) Greater than (>) Xor Modulus arithmetic (Mod) Less than or equal to ( Eqv Addition and subtraction (+, -) Greater than or equal to (>=) Imp String concatenation (&) Is & If expression is… Then result is… −3 2 −2 1 −1 0 0 −1 1 −2 2 −3 3 −4 If expression is… Then result is… 0 1 ≠0 0