1. Što je makro program?
Numeričko upravljačko programiranje s varijablama
2. Razlika između makro programa i običnog programa.
Običan program
Makro program
Mogu se koristiti samo konstante
Možete koristiti varijable i dodijeliti vrijednosti varijablama
Nema operacija između konstanti
Operacije između varijabli
Program se može izvoditi samo uzastopno, a ne skočiti
Program može skočiti
Tri. Varijable
# 1 ~ # 33
Pohranite podatke u makro program i dodijelite mu vrijednosti u programu. Dodjela je dodijeliti podatke varijabli. Na primjer, # 1 = 0 znači da je vrijednost # 1 jednaka, gdje # 1 predstavlja varijablu, # je simbol varijable, a 0 je vrijednost dodijeljena varijabli # 1.
pr
G0 X0 Y0; # 1 = 100; # 1 = 50;
G01 X100 F500; G0 X0 Y0; # 2 = 50;
G01 X # 1 F500; G0 X0 Y0;
G01 X [# 1 + # 2] F500;
The concept of macro program
The so-called user macro program actually stores a group of subprograms with variables in the system memory in advance, and calls and executes this group of programs through the macro program call instructions in the main program.
%001
T0101
M03S600
G00X105Z2
G71U1R1P1Q2X0.2Z0.2
N1G01X0
Z0
#10=0
WHILE#10LE50
#11=2【SQRT【50#10】】
G01X【#11】Z【#10】
#10=#10+5
ENDW
G01X100Z-150
X104
Z-160
N2 G00X110
G00X110Z5
M30
General steps to compile a macro program
1. Determine whether to use a macro program for the curve
Curve type: straight line segment circular (arc) conic curve trigonometric function spline
CNC system type: HNC GSK SIEMENS FANUC
2. Establish curve equation (mathematical model)
Conic section trigonometric function
3. Matching curve equation and programming axis
The corresponding and the origin of the coordinate axis
4. Determine the variables
Number of variables Independent variable Dependent variable
5. Write a program
Precautions for programming macro program
1. The distinction between the origin of mathematical expressions and the origin of programming
2. Assignment of variable initial value
3. Sequence and integration in expressions and G codes
4. Diameter and radius value
5. "Positive" and "Negative" of programming coordinates
Macro program example
1. Example of coincident origin
2. Z-direction (X-direction) has a bias example
3. Both X and Z directions have offset examples
4. Examples of parameter method
Number of variables: CNC lathe X, Z axis (generally 2)
Parametric equations are 3
CNC milling X, Y, Z axis (generally 3)
Parametric equations are 4
Independent variable: 1. The independent variable is increasing or decreasing
2. The interval (extreme value) of the independent variable is easy to find, preferably a multiple of the step length
3. For difficult calculations, additional parameters can be set
Dependent variable: After the independent variable is determined, use the independent variable to change the dependent variable, the expression can be written, and the expression is easy to write.
|