Code: Select all
IF (#100 < #4120) THEN M106 /A P-70015 F80 ELSE M105 /A P-70015 F80
Any ideas how you could handle this?
Code: Select all
;------------------------------------------------------------------------------
; Filename: cnctch.mac
; Description: Tool change request macro
; Notes: Mori Seiki SL1 Axis Based Turret
; Requires:
; I/O:
;------------------------------------------------------------------------------
#100 = #96007
IF #50001 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
IF (#4120 == #100) THEN GOTO 1000 ;Skip macro if already at position
N100 ;Insert your code between N100 and N1000
M107 ;Send requested Tool number to PLC Program
G4 P1 ;Dwell for 1 Second
M94 /11 ;Turn on Open Tool Turret Output
G4 P0.5 ;Dwell time to Open Turret Output
M101 /70016 ;Wait for Turret Open Checking if MEM16 bit is active.
G4 P0.5 ;Wait 0.5 seconds
IF (#100 < #4120) THEN M106 /A P-70015 F80 ELSE M105 /A P-70015 F80 ;Rotate Turret depending on the current tool location less than or greater than requested tool @ 80IPM unit MEM15 bit is active.
M26/A
G4 P0.5 ;Dwell for 0.5 seconds
;G0 A .1 ;Optional axis move to correct turret position
G4 P0.5 ;Dwell for 0.5 seconds
M95 /11 ;Turn Off Open Tool Turret Output
G4 P1 ;Dwell for 0.5 seconds
M94 /12 ;Turn On Output to Close Turret
G4 P0.5 ;Wait 0.5 seconds
M95 /12 ;Turn off Output to Close Turret
IF #50001 ;Prevent lookahead from parsing past here
#101 = #96007 ;Get current turret position
G10 P1950 R[#101] ;Set parameter 950 to current turret position
N1000 ;End of Macro