Delta ISPSoft — 13.1.3 Expression

ISPSoft User Manual 13.1.3 Expression An expression is an important element of a statement. It represents a value. An expression can be an arithmetic expression, a constant, a symbol, or a device. Examples are listed below.  M0 & M1 (Boolean value) The logical operator & takes M0 and M1 , and performs the logical & operation on M0 and M1 . The result of the operation is a Boolean value.  M0 = FALSE (Boolean value) The expression is a conditional expression. If M0 is ON, the Boolean value is TRUE. If M0 is OFF, the Boolean value is TRUE.  M0 (Boolean value) If M0 is ON, the Boolean value is TRUE. If M0 is OFF, the Boolean value is FALSE.

 D1 + D2 (Value) The value of the arithmetic expression D1+D2 is calculated.  D0 (Value) The value represented by the expression if the value stored in D0.  D2 = D0 + D1 (Boolean value) If the value of the arithmetic expression D0+D1 is equal to the value stored in D2, the Boolean value is value is FALSE. TRUE. If the value of the arithmetic expression D0+D1 is not equal to the value stored in D2, the Boolean  D2 := D0 + D1 ; (Statement) This is a statement rather than an expression. The value of the arithmetic expression D0+D1 is calculated, and the result of the operation is stored in D2. This statement is composed of the expression D2 and the expression D0+D1 .

Please refer to the following example. The program is mainly composed of two IF statements. When the first IF statement is executed, the system evaluates the expression M0. If M0 is ON, the value of the arithmetic expression D21+D22 will be calculated, and the result of the operation will be stored in D20. When the second IF statement is executed, the system judges whether the value of the arithmetic expression D0* (D1+D2) is equal to the value stored in D20. If the value of the arithmetic expression D0* (D1+D2) is equal to the value stored in D20, the Boolean value is TRUE, and the value of M1 is TRUE.

If the value of the arithmetic expression D0* (D1+D2) is not equal to the value stored in D20, the value of M1 is FALSE. 13-4