Macro Programming
Macro commands allow mathematical operations and conditional branching within the G-code file. Macro commands can be used with G65, and they can also be programmed using BASIC-like syntax. In the examples, usage in both forms is demonstrated as much as possible.
|
G Code |
L Code |
Operation |
Definition |
|
G65 |
L01 |
Assignment |
#A = #B |
|
G65 |
L02 |
Addition operation |
#A = #B + #C |
|
G65 |
L03 |
Subtraction operation |
#A = #B - #C |
|
G65 |
L04 |
Multiplication operation |
#A = #B * #C |
|
G65 |
L05 |
Division operation |
#A = #B / #C |
|
G65 |
L06 |
Block assignment |
#A = BMOV[5, 3] |
|
G65 |
L11 |
Logical OR operation |
#A = #B | #C |
|
G65 |
L12 |
Logical AND operation |
#A = #B & #C |
|
G65 |
L13 |
Logical XOR (Exclusive OR) operation |
#A = #B ^ #C |
|
G65 |
L14 |
Right shift |
#A = SHR[#B, 3] |
|
G65 |
L15 |
Left shift |
#A = SHL[#B, 3] |
|
G65 |
L21 |
Square root operation |
#A = SQR[16] |
|
G65 |
L22 |
Absolute value operation |
#A = ABS[-16] |
|
G65 |
L23 |
Modulus operation |
#A = 18 % 4 |
|
G65 |
L24 |
Conversion from BCD code to Binary code |
#A = BIN[18] |
|
G65 |
L25 |
Conversion from Binary code to BCD code |
#A = BCD[18] |
|
G65 |
L27 |
Right triangle hypotenuse calculation |
#A = SQRA[10, 15] |
|
G65 |
L28 |
Right triangle side calculation |
#A = SQRS[10, 15] |
|
G65 |
L31 |
Sine calculation |
#A = SIN[#B, 450000] |
|
G65 |
L32 |
Cosine calculation |
#A = COS[#B, 450000] |
|
G65 |
L33 |
Tangent calculation |
#A = TAN[#B, 450000] |
|
G65 |
L34 |
Arctangent calculation |
#A = ATAN[#C, #B] |
|
G65 |
L35 |
Arcsine calculation |
#A = ASIN[#B, #C] |
|
G65 |
L36 |
Arccosine calculation |
#A = ACOS[#B, #C] |
|
G65 |
L80 |
Unconditional branching to a specific line |
GOTO 300 |
|
G65 |
L81 |
Conditional branching to a specific line |
IF #A == 100 THEN GOTO 300 |
|
G65 |
L82 |
Conditional branching to a specific line |
IF #A <> 100 THEN GOTO 300 |
|
G65 |
L83 |
Conditional branching to a specific line |
IF #A > 100 THEN GOTO 300 |
|
G65 |
L84 |
Conditional branching to a specific line |
IF #A < 100 THEN GOTO 300 |
|
G65 |
L85 |
Conditional branching to a specific line |
IF #A >= 100 THEN GOTO 300 |
|
G65 |
L86 |
Conditional branching to a specific line |
IF #A <= 100 THEN GOTO 300 |
|
G65 |
L87 |
Unconditional branching to a specific line with cursor |
INDX 10 |
|
G65 |
L99 |
Trigger an alarm |
ALM 1 |
