Content Preview
TB300 Rev6 β Custom Macros Aux Keys and Wireless MPG Macros
Create a Custom M code and Map it to an Auxiliary Key
Related Document Introduction to Centroid Acorn CNC12 Macros
https //www centroidcnc com/centroid_diy/downloads/acorn_documentation/
centroid_cnc_macro_programming pdf
Common Uses
1 Set X and Y zero position with one button push
2 Move XYZ or XY to a predetermined position
3 Turn on or off an output to control anything that you would control with an output lights dust collection lube
pump shot vac hold down etc etc
Three easy steps
1 Create a G&M code program that you want to run when an Auxiliary key is pressed
2 Save it as a Custom M code using the proper custom M code name
3 Map the new Custom M code to a spare Auxiliary key using Auxiliary key parameters
Example Open any text editor and create the G&M program you would like to execute when pressing an Aux key
For this example we will βprogramβ Aux key #5
For this example we will be creating a custom M code program to move the X and Y axis to X0 0000 Y0 0000
position by pressing Aux key 5
1 Open editor and create a program with G0 X0 Y0 as the first line
2 Save this G&M code program with the file name mfunc72 mac save in the cnc11/12 installed directory typically
c \ cncm for mill and c \cnct for lathe
192 168 0 199/public/tech/technical bulletins/tb300 odt 5/8/2019 Page 1 of 5
TB300 Rev6 β Custom Macros Aux Keys and Wireless MPG Macros
3 Map the custom M code to an Auxiliary key F1 Setup F3 Config F3 parameters Navigate to P192 Set P192
to 7211 press F10 to save 72 is the custom M code # to be used and 11 tells the control you want the Aux key to
use a custom Mcode
Note Parameters 188 thru 199 are used to control the behavior of the auxiliary keys on the operator panel and
map them to the custom M code file P192 controls the behavior of Aux 5
192 168 0 199/public/tech/technical bulletins/tb300 odt 5/8/2019 Page 2 of 5
TB300 Rev6 β Custom Macros Aux Keys and Wireless MPG Macros
4 Test Verify the machine is ready to move to X0 Y0 Now test the feature by pressing Aux5 at the main screen
The machine should make a rapid move to X0 Y0
Notes
β’ The M72 custom M code we just created will work like any other M code and can be called out in a G and M code
program or using MDI mode as well
β’ You can not use the Aux keys to set bits directly using M94/M95 You can however create a custom macro that
calls M94/M95 to set a bit
β’ Many machines like ATC machines will already be using several custom M codes When creating a
new custom M code Do not overwrite these existing custom M code programs You can see all
custom M codes in the c \cncm or c \cnct directory When creating a new custom M code choose a
Custom M code number that is not already being used
β’ Before creating a new custom M code create a backup of the existing cnc control configuration which
includes the current M codes by creating a report by pressing F7 Utility F7 Create report from the
main menu You can always βrestoreβ the report to bring the machine back to the original configuration
β’ Once you have created custom M codes and are satisfied with their functionality Generate another
report to save a backup of your machine with the new M codes
Using the Canned Auxiliary Key Canned Functions
Auxiliary key parameters # 188 thru 199 also have βcannedβ functionality that can be activated by simply setting the
parameter value to any of these values below
192 168 0 199/public/tech/technical bulletins/tb300 odt 5/8/2019 Page 3 of 5Function
No function 0
Input X Axis position 1
Input Y Axis position 2
Input Z Axis position 3
Set Absolute Zero 4
Set Incremental Zero 5
One shot Drill 6
One shot β Circular Pocket 7
One shot β Rec Pocket 8
One shot β Frame 9
One shot β Face 10
Execute M code file mcode# 11
Free Axis remove power 14
Go to power feed menu 15
XYZ set Absolute Zero 16
One Shot β Drill BHC 17
One Shot β Drill Array 18Set Aux Key parameters #188
Aux1 thru #199 Aux 12 to
any of these values
TB300 Rev6 β Custom Macros Aux Keys and Wireless MPG Macros
Centroid CNC Acorn Control
The Acorn has default macros for turning on and off general purpose outputs as listed below
β’ M61 M68 turn on OUTPUT1 OUTPUT8 respectively M94/61 M94/68
β’ M81 M88 turn off OUTPUT1 OUTPUT8 respectively M95/61 M95/68
You will need to use the Wizard to assign your outputs in the PLC
Wireless MPG Macros
Allin1DC/Oak
Wireless MPG Macros are found in the c \cncm\system or c \cnct\system directory Installations of the CNC12
V4 16 and later come with example macro files named plcmacro1 mac plcmacro2 mac plcmacro3 mac and
plcmacro4 mac for the wireless mpg aux keys 1 2 3 and 4 If you are missing these examples files copy the
example at the end of this Tech bulletin into your editor and save as plcmacro1 mac in your cncm\system directory
The default function of the macro will be to display the following message
"This is an example macro run from the Macro1 button on the centroid CWP 4 MPG The macro is named
plcmacro1 mac and can be found in the \cncm\system directory Edit to include the desired functionality
Press ESC or Cycle Cancel to Exit "
Editing the file to include desired functionality is similar to other macro functions except that the code must be
between lines N100 and N1000 for proper functionality Additionally deleting or commenting out the M225 message
line is required to disable the example message from appearing when pressing the aux keys For example if we
wanted the mpg key 1 to bring x and y axis back to zero like the earlier example we would edit plcmacro1 mac and
add the line "G0 X0 Y0" between N100 and N1000
N100
G0 X0 Y0
N1000 ;end
Acorn
Acorn systems allow easy access to the plc function file via the acorn wizard The Acorn wizard can be opened by
running the CNC software Utilities F7 then Acorn Wizard F10 In the wizard navigate down to Control Peripheral
and then Wireless MPG Under Macro Button Configuration pressing any one of the 4 "edit MPG macro" buttons will
open up a text editor of the macro code for each individual button
192 168 0 199/public/tech/technical bulletins/tb300 odt 5/8/2019 Page 4 of 5
TB300 Rev6 β Custom Macros Aux Keys and Wireless MPG Macros
Example Wireless MPG Macro
;
; Filename plcmacro1 mac
; Description User Customizable Macro
; Notes
; Requires Machine home must be set prior to use
; 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
N1000 ; end
Document History
Rev6 Added link to Intro to Acorn CNC12 Macros 3/13/2020 #423
Rev5 created 05 08 19 by #423 and #432
192 168 0 199/public/tech/technical bulletins/tb300 odt 5/8/2019 Page 5 of 5