Page 1 of 2

M15 macro coding

Posted: Thu Jul 22, 2021 1:09 pm
by alimumtaz101
Hi everyone,
I am making a milling machine and as far as now everything is pretty smooth and solid.
Now i am working on rack type ATC and i am almost done with it but, i am person of understanding rather than copy and paste.

below is the M15 built-in macro of centroid acorn (for the tool changer), I have completely understood the code of M6, and M16.

I am just confused in the one line of M15 code which I mention below.

can anyone tell me what this is and what is this IF (#9402 != 0), what is this #9402, I tried to find it in the manual with no success.

thanks
......

;M15 Macro

(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 /15 ;Turn on ToolUnclamp request
IF (#9402 != 0) THEN GOTO 200
G4 P3 ;Wait 3 seconds
GOTO 1000

N200
M101 /70012 ;Wait until tool is unclamped

N1000 ;End of Macro)

Re: M15 macro coding

Posted: Thu Jul 22, 2021 2:06 pm
by martyscncgarage
alimumtaz101 wrote: Thu Jul 22, 2021 1:09 pm Hi everyone,
I am making a milling machine and as far as now everything is pretty smooth and solid.
Now i am working on rack type ATC and i am almost done with it but, i am person of understanding rather than copy and paste.

below is the M15 built-in macro of centroid acorn (for the tool changer), I have completely understood the code of M6, and M16.

I am just confused in the one line of M15 code which I mention below.

can anyone tell me what this is and what is this IF (#9402 != 0), what is this #9402, I tried to find it in the manual with no success.

thanks
......

;M15 Macro

(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 /15 ;Turn on ToolUnclamp request
IF (#9402 != 0) THEN GOTO 200
G4 P3 ;Wait 3 seconds
GOTO 1000

N200
M101 /70012 ;Wait until tool is unclamped

N1000 ;End of Macro)
You had posted this to the success stories Forum. I moved it here to the Acorn forum.
Please post a report, Which motion controller are you using?

Marty

Re: M15 macro coding

Posted: Thu Jul 22, 2021 2:21 pm
by tblough
Variables 9000-9399 correspond to parameter values 0 - 399. Parameter 402 does not currently have an official function assigned so without knowing more about your machine, I can't tell you much more.

Program values are described in Chapter in the CNC12 user's manual: https://www.centroidcnc.com/centroid_di ... -v4.14.pdf

Parameters are described in Chapter 15.

Re: M15 macro coding

Posted: Thu Jul 22, 2021 3:52 pm
by Nigelo
Tom, param 402 does have a function assigned in v4.64 (and v4.62 but not v4.14 to which the manual refers) which states "Axes paired enabled". My router shows a param 402 value of 0 correctly indicating Not Enabled.

I posted this reply to Ali on the Facebook group but cannot fathom how this would affect his Auto chuck operation

Re: M15 macro coding

Posted: Thu Jul 22, 2021 3:55 pm
by cncsnw
The manual description is out of date.

Variables #9000 - #9999 correspond to Machine Parameter values 0 - 999.

Variable #9402, then, retrieves the value of Machine Parameter 402.

From context, it appears that whoever wrote the macro intended that Parameter 402 be used to show whether there was a tool-unclamped confirmation switch, which the PLC program would be responsible for echoing into MEM12 (#70012). Apparently that proposed use was never documented, and was never communicated to whomever decided to use P402 for axis pairing instead.

Re: M15 macro coding

Posted: Thu Jul 22, 2021 3:56 pm
by cncsnw
Interestingly, P402 is also absent from the only documentation that appears to apply:
https://www.centroidcnc.com/centroid_di ... meters.pdf

Re: M15 macro coding

Posted: Thu Jul 22, 2021 11:14 pm
by alimumtaz101
Hi marty,
Thanks for moved it here, regarding the report i am not at workplace here is 5 days off, i am just reading the code and manual and understanding everything. And also report doesnt matter because as i told i am not getting any error, just was confused about this line that what was the purpose of it since this not mentioned anywhere.

I am using acorn with 4.6 version also have ether1616 connected, they machine is completly diy milling machine have 4 axis. Everything is working fine till now.

Re: M15 macro coding

Posted: Thu Jul 22, 2021 11:20 pm
by alimumtaz101
As nigelo mentioned me on facebook regarding this parameter for the axis paired, but i think after reading cncsnw comment this line of code is useless for me, if i remove it so it will not effect anything (will try), because i think this line had never executed in any ATC attempt.

One question what is this paired axis means, does it use when we have slave axis?

Re: M15 macro coding

Posted: Thu Jul 22, 2021 11:39 pm
by alimumtaz101
;------------------------------------------------------------------------------
; Filename: mfunc15.mac
; Description: Tool unclamp macro
; Notes:
; Requires:
;
; Inputs:
; ToolIsUnclamped IS INP2
;
; Outputs:
; ToolUnclamp IS OUT8
;------------------------------------------------------------------------------


above is the description of the m15 macro, and I am confused why it is mentioned there and advise to declare inp2 in the wizard as ToolIsUnclamped.
since this INP2 is never used in the coding, I know I can use it if I attach one sensor on my jack, nd write m101 for INP2.
but instead of this i found this #9402 with MEM12 bit of plc to wait till change of state.

Re: M15 macro coding

Posted: Mon Jul 26, 2021 9:05 am
by cnckeith
please post a fresh report.zip