Page 2 of 2

Re: M Codes For Open/Close Chuck

Posted: Mon Apr 08, 2019 7:59 pm
by Ken Rychlik
Are you just using one output for opening and closing the chuck? Say for instance, it is output 4

Using Mick's method.....

Your macro could be something like
M64 (turns on ouput 4)
G4 P2 (2 second pause)
M84 (turns off output 4)

Re: M Codes For Open/Close Chuck

Posted: Tue Apr 09, 2019 6:01 am
by eflor8234
Ken Rychlik wrote: Mon Apr 08, 2019 7:59 pm Are you just using one output for opening and closing the chuck? Say for instance, it is output 4

Using Mick's method.....

Your macro could be something like
M64 (turns on ouput 4)
G4 P2 (2 second pause)
M84 (turns off output 4)
That's all I'm doing. I'm new to this and some of the macros looked pretty intimidating. If it's that simple, I'm a happy man.

Would that macro result in an auto off for the output? Right now my open/close sequence looks like this:

m35- output seven turns on (hydraulic solenoid activates to open chuck)
m36- output seven turns off (solenoid is inactive)
m33- output eight turns on (hydraulic solenoid activates to close chuck)
m34- output eight turns off (hydraulic solenoid inactive)

What I'd like to have happen and what the wizard says should happen is:

chuckopen m14- output seven turns on (hydraulic solenoid activates to open chuck)

The wizard instructs to go to parameter 992 to set the auto off timer for the m14 command. Since this isn't working, I'd like the result of the single M-code to be this:

OpenChuck M14: output turns on for 2 seconds and then turns off automatically.
CloseChuck M16: output turns on for 2 seconds and then turns off automatically.

If this is my starting macro...

;------------------------------------------------------------------------------
; Filename: mfunc64.mac
; Wizard OUTPUT4 M-code Macro: M64
; Description: User Customizable Macro
; Notes: Use Acorn Wizard i/o map to set Acorn Output 4 = to "OUTPUT4" then this macro (M64) will turn on that output
; 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 /64 ;Request OUTPUT4

N1000 ;End of Macro



Would this be what my finished macro would look like?


;------------------------------------------------------------------------------
; Filename: mfunc64.mac
; Wizard OUTPUT4 M-code Macro: M64
; Description: User Customizable Macro
; Notes: Use Acorn Wizard i/o map to set Acorn Output 4 = to "OUTPUT4" then this macro (M64) will turn on that output
; 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 /64 ;Request OUTPUT4
G04 P2
M95 /64
N1000 ;End of Macro


Thanks! My big concern is that during MDI operations I will forget to shutoff one of my open/close inputs before activating the opposite. Both sides of the solenoid would be receiving current.

Re: M Codes For Open/Close Chuck

Posted: Tue Apr 09, 2019 6:06 am
by eflor8234
mick41zxr wrote: Mon Apr 08, 2019 6:26 pm Looking at the Macro's in your report I don't think you have your outputs configured correctly.

Try testing by leaving the output set as OUTPUT#
Then using a,
M94 /61 ;to open output 1.... 62 for out2 etc
To close output use,
M95 /61 ;to close output 1
or you can use a M61 & M81 directly.
Thanks!

How much will my formatting of the macro come into play? Does each line need certain symbols or capitalization?

Is it as simple as...

;M94 /61
;G04 P2
;M95 /61

Thanks!

Re: M Codes For Open/Close Chuck

Posted: Tue Apr 09, 2019 7:31 am
by Ken Rychlik
Try each command one at a time in the MDI and then stack them in your macro. If you enter something that it won't accept, it will give you a message. Capitols do not matter.

Re: M Codes For Open/Close Chuck

Posted: Tue Apr 09, 2019 7:53 am
by Ken Rychlik
try this in your macro. No warranty expressed or implied. lol

M5 ;Turn off spindle (there could be a better "if spindle is on abort" type of safety
M67 ;Turn on output 7
G04 P2 ;2sec pause
M87 ;Turn off output 7
M200 "#)**Change Tool Now**\nPress Cycle Start to continue"
M68 ; Turn on output 8
G04 P2 ;2sec pause
M88 ; turn off output 8

If I messed anything up, maybe the guru's will help.

Re: M Codes For Open/Close Chuck

Posted: Tue Apr 09, 2019 8:01 am
by Ken Rychlik
Then when you get it doing what you want, you can assign it one of the aux buttons on top.

Also for the M67 M87 to work the output 7 needs to be on ouput 7 in the wizzard screen. Otherwise you will have to substitue the commands you have working there.

Re: M Codes For Open/Close Chuck

Posted: Tue Apr 09, 2019 9:33 am
by eflor8234
I have this working for both M68 and M67

I'll try the suggested ones when I get more time to play. Thanks!
Thanks for the help

N100 ;Insert your code between N100 and N1000

M94 /68 ;Request OUTPUT8

G4 p3

M95 /68 ;Request OUTPUT8

N1000 ;End of Macro

Re: M Codes For Open/Close Chuck

Posted: Mon Apr 15, 2019 9:31 am
by Centroid_Tech
Looks like there was a piece of logic in the PLC program that was preventing the ChuckTimer from actually being set. Please copy the attached file into the c:\cnct\WizardResources\Template directory. You will need to open up the Wizard and change something in the I/O list of the main page in order for the Wizard to create a new PLC program with the update .src file.