M15 macro coding

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Allin1Chris
Posts: 132
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: M15 macro coding

Post by Allin1Chris »

Hi alimumtaz101,

The Line "IF (#9402 != 0) THEN GOTO 200" was to determine if an input was assigned by the user or not, if the user did have an input then we would wait for the input to change states, otherwise wait 3 seconds. However, 9402 was never implemented (and instead was used for an axis pairing feature). This was left over code in the macro that has been overlooked.

However, i do have some updated macros that will be part of the next version of acorn released.

Code: Select all

;------------------------------------------------------------------------------
; Filename: mfunc15.mac
; Description: Tool Unclamp Macro
; Notes: Uses MEM 261 and MEM266 to determine if user has an active input.
; Requires: CNC12 V4.66 ACORN
; Revision Date: 26 JUL 2021
; Please see TB300 or the following link for tips on writing custom macros.
; https://www.centroidcnc.com/centroid_diy/downloads/acorn_documentation/centroid_cnc_macro_programming.pdf
;------------------------------------------------------------------------------
; PLC Variables:
; ToolUnclampedState_M		IS MEM12 (#70012)
; DrawBarReleasedDisable_M	IS MEM261 (#70261)
; ToolIsUnclampedDisable_M	IS MEM266 (#70266)
;------------------------------------------------------------------------------
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 #70261 && #70266 THEN GOTO 200	;Determine if input is used.
M101 /70012                      	;Wait until tool is Unclamped.
GOTO 1000

N200
G4 P3					;Wait 3 seconds

N1000					;End of Macro
This should work in the current 4.64 version released as well. Hope that clarifies it for you.
When requesting support READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Please ALWAYS post a FRESH report. To make a report: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)

Centroid PLC Tutorial Videos
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 »

Thanks chris, i got it now.
Thanks for the update.
Post Reply