秋葵官网网站入口

Navigation: English>> Technical Support>>

Nc machine tool

FWV-L850Design and application of parametric CNC programming for machining center

CopyFrom: Foshan South China Sea South China Machinery Co., Ltd. UpdateTime: 07-28-2015 Hits:

3.2 macro program local variable assignment

? ? Local variables can be used to transfer data from the user to the macro, and only when the macro program calls and handles them. After the completion of the macro program, each local variable will become null, and can not pass between the macro. Local variables can be defined in 33, and the range is #1~#33. In the macro program, each local variable corresponds to a specified letter in English. In the assignment list, G65 macros can only be defined 21 variables and the remaining 12 variables can be defined within the body of the macro program, respectively #10, #12, #14, #15, #16, #27, #28, #29, #30, #31, #32, #33. These variables can be redefined. Re use. ?

自(zi)變量的地址

變量號

自變量的地(di)址

變量號(hao)

A

#1

Q

#17

B

#2

R

#18

C

#3

S

#19

D

#7

T

#20

E

#8

U

#21

F

#9

V

#22

H

#11

W

#23

I

#4

X

#24

J

#5

Y

#25

K

#6

Z

#26

M

#13

?

?

? ? ? ? ? ? ? ? ? ? ? ? Table 1 local variable address and variable number

? ? ? The removal of the local variable can be done by the control panel, or by the use of the program code. When you press the reset or emergency stop button on the control panel, you can remove all local variables; you can also remove all local variables after executing the M30 or M99 code.

3.3 macro program function
? ?Macro program has a powerful function, the function can be divided into six groups: arithmetic functions, trigonometric function, integral function and auxiliary function, logic function, transform function. Arithmetic functions have the sum, difference, product and addition, and their arithmetic symbols are +, -, *, and /. The trigonometric sine, cosine function, tangent and arctangent function and its symbols were sin, cos, tan and atan.The integral function has four to five homes, the integral function rounding up and down function integral function,The symbols are ROUND, FUP, FIX. The auxiliary function has the square root function, the absolute value function, the natural logarithm function, the exponential function with E as the bottom, and the addition of the fractional function, whose sign is SQRT, LN, ABS, ADP, EXP. The logical function is equal to, not equal to, greater than, less than, no less than, no more than, the symbol of EQ, GE, NE, GT, LT, LE. The transformation function has BCD and BCD, the BIN function converts binary encoding's decimal format to binary format, and the BIN function converts the binary format into a binary encoding decimal format.

3.4 branches and loops

? ? In the macro program, the function of the branch and the loop has IF function and WHILE function.
? ? Format for the IF function:
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? IF [condition is true] N GOTO
? ??N is a branch to the program, when the condition is true, the program will continue to program N. If the condition is true, the program will skip all the statements between the IF and the GOTON. If the condition is not true, the program will continue to execute the IF function.
? ??The structure of the WHILE function is:

WHILE [Condition] DOn

……

ENDn

Execute the loop body as long as the specified condition is true. Don action and the end of the cycle of the establishment of a link, here n and ENDn expression in the n.

  • Previous article: Nothing!
  • Later article: Nothing!