
02-04-2011, 07:08 AM
|
| | | Join Date: Sep 2010 Location: Australia
Posts: 733
| |
Originally Posted by tonper Hey, so I'm tying to run the following on a Makino V55 (FANUC 16M PRO 3) Mill. Code: %
O100 (zerochange)
(X)#1=-0.01
(Y)#2=0.02
(Z)#3=0.03
IF [#102 EQ 1] GOTO 10
GOTO 20
N10 #102 = 2
GOTO 100
N20 IF [#102 EQ 2] GOTO 30
GOTO 50
N30 #102=1
GOTO 100
N50 #102=1
N100 IF [#102 EQ 1] GOTO 200
IF [#102 EQ 2] GOTO 300
N200 #4=-791.38+#1
#5=-245.92+#2
#6=-433.38+#3
GOTO 500
N300 #4=-791.38-#1
#5=-245.92-#2
#6=-433.38-#3
GOTO 500
N500 G90 G10 L2 P3 X#4 Y#5 Z#6
% But seams as the problem is that vaiable #102 wont save untill next run.
Isn't #100 block variables saved in memory after program end?
It should set G56 workspace X, Y and Z offset by what I input in #1, #2 and #3. And at next run do it reversed.
Anyway, I've tested and the code seams to be working, it's just that I guess the #102 variable is resetted at program stop...
Anyone that has some clues? |
Under normal conditions (Fanuc default parameters) common variables in the #100 through #149 (#199) range are cleared with M30 or Reset. However, clearing them can be prevented by setting bit 6 of parameter 6001 to 1. Local variables #1 though #33, can be retained in a similar manner by setting bit 7 of parameter 6001 to 1. It may be simpler just to use a common variable in the range #500 though #549 (#599). These are non volatile and retain their values even when power is withdrawn from the control.
Regards,
Bill |