diycncscott wrote: ↑Fri Dec 01, 2017 8:53 am
Yes. You will need to create a custom mfunc6.mac (M6 is called during a tool change) and put and if then statement in there based on the tool #.
There are Mfunctions defined for OUTPUT1-OUTPUT8.
;OUTPUT1-8
IF M61 THEN (OUTPUT1)
IF M62 THEN (OUTPUT2)
IF M63 THEN (OUTPUT3)
IF M64 THEN (OUTPUT4)
IF M65 THEN (OUTPUT5)
IF M66 THEN (OUTPUT6)
IF M67 THEN (OUTPUT7)
IF M68 THEN (OUTPUT8)
First, use the Wizard to assign out7 as OUTPUT7 (and 8 as 8)
Then add something like this to your mfunc6.mac -create one in c:\cncm if it does not exist using an existing mfunc as a template. I'll use mfunc66.mac in this example and rename as mfunc6.mac:
Original mfunc66.mac
;------------------------------------------------------------------------------
; Filename: mfunc66.mac
<---- Rename as mfunc6.mac
; OUTPUT1 (NOT the same as OUT6) macro
<--- remove this comment line
; Description: User Customizable Macro
<---- change description to "tool change macro"
; Notes:
; Requires:
; Please see TB300 for tips on writing custom macros.
;------------------------------------------------------------------------------
IF #50010 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
N100 ;Insert your code between N100 and N1000
M94 /66 ;Request OUTPUT6
<----- remove this line
N1000 ;End of Macro
New mfunc6.mac
;------------------------------------------------------------------------------
; Filename: mfunc6.mac
; Description: Tool change macro
; Notes:
; Requires:
; Please see TB300 for tips on writing custom macros.
;------------------------------------------------------------------------------
IF #50010 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
N100 ;Insert your code between N100 and N1000
;Note this will only turn off outputs assigned as OUTPUT1-OUTPUT8. It will NOT effect the
;ouput if it was assigned as something else
IF 1 == 1 THEN M81 ;Probably want to turn off outputs set by previous tool change(s) turn off OUTPUT1
IF 1 == 1 THEN M82 ;Probably want to turn off outputs set by previous tool change(s) turn off OUTPUT2
IF 1 == 1 THEN M83 ;Probably want to turn off outputs set by previous tool change(s) turn off OUTPUT3
IF 1 == 1 THEN M84 ;Probably want to turn off outputs set by previous tool change(s) turn off OUTPUT4
IF 1 == 1 THEN M85 ;Probably want to turn off outputs set by previous tool change(s) turn off OUTPUT5
IF 1 == 1 THEN M86 ;Probably want to turn off outputs set by previous tool change(s) turn off OUTPUT6
IF 1 == 1 THEN M87 ;Probably want to turn off outputs set by previous tool change(s) turn off OUTPUT7
IF 1 == 1 THEN M88 ;Probably want to turn off outputs set by previous tool change(s) turn off OUTPUT8
;#4120 stores the value of the requested tool #
IF #4120 == 1 THEN G4 P1 ;Wait 1 second
IF #4120 == 1 THEN M67 ;Turn on OUTPUT7
IF #4120 == 2 THEN M68 ;Turn on OUTPUT8
N1000 ;End of Macro
Don't forget to save as mfunc6.mac in c:\cncm
If you want the output to turn off at end of program you will need to add M87, M88 etc.. to end of you program