EasyManuals Logo

Haas Mill User Manual

Haas Mill
217 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #104 background imageLoading...
Page #104 background image
97
96-8000 rev R June 2007
Macros
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 M99 P10;
branches to line N10. It does not return control to the calling subroutine. With macros enabled, M99 can be used
with a conditional expression to branch conditionally. To branch when variable #100 is less than 10 we could code
the above line as follows.
N50 [#100 LT 10] M99 P10;
In this case, the branch occurs only when #100 is less than 10, otherwise processing continues with the next
program line in sequence. In the above, the conditional M99 can be replaced with
N50 IF [#100 LT 10] GOTO10;
Arithmetic Expressions
An arithmetic expression is any expression using variables, operators, or functions. An arithmetic expression returns
a value. Arithmetic expressions are usually used in assignment statements, but are not restricted to them.
Examples of Arithmetic expressions: #101=#145*#30;
#1=#1+1;
X[#105+COS[#101]];
#[#2000+#13]=0;
Assignment Statements
Assignment statements allow the programmer to modify variables. The format of the assignment statement is:
<expression>=<expression>
The expression on the left of the equal sign must always refer to a macro variable, whether directly or indirectly. The
following macro initializes a sequence of variables to any value. Here both direct and indirect assignments are used.
O0300 (Initialize an array of variables) ;
N1 IF [#2 NE #0] GOTO2 (B=base variable) ;
#3000=1 (Base variable not given) ;
N2 IF [#19 NE #0] GOTO3 (S=size of array);
#3000=2 (Size of array not given) ;
N3 WHILE [#19 GT 0] DO1 ;
#19=#19-1 (Decrement count) ;
#[#2+#19]=#22 (V=value to set array to) ;
END1 ;
M99 ;
The above macro could be used to initialize three sets of variables as follows:
G65 P300 B101. S20 (INIT 101..120 TO #0) ;
G65 P300 B501. S5 V1 (INIT 501..505 TO 1.0) ;
G65 P300 B550. S5 V0 (INIT 550..554 TO 0.0) ;
The decimal point in B101., etc. would be required.
Control Statements
Control statements allow the programmer to branch, both conditionally and unconditionally. They also provide the
ability to iterate a section of code based on a condition.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Haas Mill and is the answer not in the manual?

Haas Mill Specifications

General IconGeneral
Travels X AxisVaries by model
Travels Y AxisVaries by model
Travels Z AxisVaries by model
Spindle SpeedVaries by model
Spindle MotorVaries by model
Table SizeVaries by model
Rapid Traverse RatesVaries by model
Tool CapacityVaries by model
Max Cutting RateVaries by model
Spindle TaperVaries by model

Related product manuals