B8961 and B8962 User Manual
54
Logical Operations on Expressions (&&,||)
Conditional commands (IF,WT, LU, LW) support logical operations of AND (&&)
and OR (||). Two expressions may be logically AND’d or OR’d within one condi-
tional command. For example:
(A)=5 (B)=2.5 IF(A)>2&&(B)=2.5 MS1, “True Statement” EB
In the above program,the message “True Statement” would appear since BOTH
conditional statements are true,thus making the entire IF conditional true.
Incrementing and Decrementing Variables (++, =+, --, -=)
There are four syntaxes supported by var+ (single increment),+= (value
increment),-- (single decrement),-= (value decrement).These operators will initial-
ize any uninitialized variable to zero before incrementing or decrementing it for
the first time.
(Variable Name)++
Increments a variable value by 1
(Variable Name)+=n
Increments a variable value by n
(Variable Name)--
Decrements a variable value by 1
(Variable Name)-=n
Decrements a variable value by n
Expressions
The SmartDrive supports five conditional expressions:less than (<),equal to (=),
greater than (>),less than or equal to (<=),and greater than or equal to (>=). The
IF and WT commands can use these expressions to direct prog ram flow or wait for
an analog input to meet a condition.The > and < symbols are entered into the key-
pad editor with the ALPHA+
↑
+
↑
....
↑
Examples:
IF (X)>10 GS20 EB
If X is greater than 10 gosub to prog ram #20
WT(AI12)<(MAX TEMP)
Wait for the temperature to go below the maximum
before continuing command processing.
AND
OR
Expression A Expression B
A & B
Expression A Expression B
A || B
False
False
False
False
False
False
False
True
False
False
True
True
True
False
False
True
False
True
True
True
True
True
True
True
Содержание B8961
Страница 111: ...109 Chapter 7 Programming with Serial Communication...
Страница 132: ...B8961 and B8962 User Manual 130...
Страница 136: ...B8961 and B8962 User Manual 134 B8961 and B8962 Hardware Connections...
Страница 137: ...135 Chapter 8 Hardware Reference B8961 and B8962 Input and Output Schematics...
Страница 138: ...B8961 and B8962 User Manual 136 Connecting IDC Limit Switches to the B8961 2...
Страница 156: ...B8961 and B8962 User Manual 154...