108
96-8000 Rev AC
May 2010
IF [[#1 GT 3.0] AND [#2 LT 10]] GOTO1
Here control will transfer to block 1
because “#1 GT 3.0” evaluates to 1.0
and “#2 LT 10” evaluates to 1.0, thus
1.0 AND 1.0 is 1.0 (TRUE) and the
GOTO occurs.
Note that care must be taken when using logical operators so that the desired
result is achieved.
Boolean Operators
Boolean operators always evaluate to 1.0 (TRUE) or 0.0 (FALSE). There are
six Boolean operators. These operators are not restricted to conditional expres
-
sions, but they most often are used in conditional expressions. They are:
EQ - Equal to
NE - Not Equal to
GT - Greater Than
LT - Less Than
GE - Greater than or Equal to
LE - Less Than or Equal to
The following are four examples of how Boolean and Logical operators can be
used:
Example
Explanation
IF [#1 EQ 0.0] GOTO100;
Jump to block 100 if value in variable #1 equals
0.0.
WHILE [#101 LT 10] DO1;
While variable #101 is less than 10 repeat loop
DO1..END1.
#1=[1.0 LT 5.0];
Variable #1 is set to 1.0 (TRUE).
IF [#1 AND #2 EQ #3] GOTO1
If variable #1 logically ANDed with variable #2
is equal to the value in #3 then control jumps to
block 1.
Expressions
Expressions are defined as any sequence of variables and operators sur
-
rounded by the square brackets “[“ and “]”. There are two uses for expressions:
conditional expressions or arithmetic expressions. Conditional expressions
return FALSE (0.0) or TRUE (any non zero) values. Arithmetic expressions use
arithmetic operators along with functions to determine a value.
Conditional Expressions
In the HAAS control, ALL expressions set a conditional value. The value is
either 0.0 (FALSE) or the value is nonzero (TRUE). The context in which the
expression is used determines if the expression is a conditional expression.
Conditional expressions are used in the IF and WHILE statements and in the
M99 command. Conditional expressions can make use of Boolean operators to
help evaluate a TRUE or FALSE condition.
The M99 conditional construct is unique to the HAAS control. Without macros,
M99 in the HAAS control has the ability to branch unconditionally to any line in
the current subroutine by placing a P code on the same line. For example:
N50
Summary of Contents for 96-8000
Page 15: ...6 96 8000 Rev AC May 2010 Mill Warning Decals ...
Page 16: ...7 96 8000 Rev AC May 2010 Safety Lathe Warning Decals ...
Page 41: ...32 96 8000 Rev AC May 2010 ...
Page 93: ...84 96 8000 Rev AC May 2010 ...
Page 129: ...120 96 8000 Rev AC May 2010 ...
Page 133: ...124 96 8000 Rev AC May 2010 ...
Page 268: ......
Page 269: ......