M15 macro coding

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

alimumtaz101
Posts: 18
Joined: Thu May 06, 2021 1:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: No
CNC11: No
CPU10 or CPU7: No

M15 macro coding

Post 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)
martyscncgarage
Posts: 9912
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

Re: M15 macro coding

Post 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
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
tblough
Posts: 3072
Joined: Tue Mar 22, 2016 10:03 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: 100505
100327
102696
103432
7804732B977B-0624192192
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Boston, MA
Contact:

Re: M15 macro coding

Post 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.
Cheers,

Tom
Confidence is the feeling you have before you fully understand the situation.
I have CDO. It's like OCD, but the letters are where they should be.
Nigelo
Posts: 366
Joined: Tue Dec 11, 2018 4:03 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: F045DA80C8B8-0905181172
E415F6F70BC3-0318203049
98F07B91FC6B-0123236802
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK

Re: M15 macro coding

Post 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
"You can lead a horse to water but you cannot force it to drink"
Hope this helps
Nigel
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: M15 macro coding

Post 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.
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: M15 macro coding

Post by cncsnw »

Interestingly, P402 is also absent from the only documentation that appears to apply:
https://www.centroidcnc.com/centroid_di ... meters.pdf
alimumtaz101
Posts: 18
Joined: Thu May 06, 2021 1:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: No
CNC11: No
CPU10 or CPU7: No

Re: M15 macro coding

Post 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.
alimumtaz101
Posts: 18
Joined: Thu May 06, 2021 1:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: No
CNC11: No
CPU10 or CPU7: No

Re: M15 macro coding

Post 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?
alimumtaz101
Posts: 18
Joined: Thu May 06, 2021 1:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: No
CNC11: No
CPU10 or CPU7: No

Re: M15 macro coding

Post 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.
cnckeith
Posts: 7166
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: M15 macro coding

Post by cnckeith »

please post a fresh report.zip
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
Post Reply