Wmpg macros?

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

Post Reply
repauli1
Posts: 156
Joined: Thu Jul 09, 2020 9:50 pm
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Wmpg macros?

Post by repauli1 »

Which manual covers the macros in the Wireless MPG Pendant? Cannot locate info.
Thanks in advance.
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: Wmpg macros?

Post by cncsnw »

The following comment and code appear in a typical factory PLC program:
;By setting SV_SYS_MACRO to a value of something other than zero, the PLC is
;requesting CNC12 to run the corresponding macro in the c:\cncm\system directory
;Setting SV_SYS_MACRO = 1, run c:\cncm\system\macro1.mac. Cnc12 will not run the
;same macro twice in a row unless SV_SYS_MACRO has been set to 0 between requests.
IF MpgMacro1PD_PD THEN SV_SYS_MACRO = 1
IF MpgMacro2PD_PD THEN SV_SYS_MACRO = 2
IF MpgMacro3PD_PD THEN SV_SYS_MACRO = 3
IF MpgMacro4PD_PD THEN SV_SYS_MACRO = 4
IF (SV_SYS_MACRO > 0) && !(MpgMacro1PD_PD || MpgMacro2PD_PD || MpgMacro3PD_PD || MpgMacro4PD_PD)
THEN SV_SYS_MACRO = 0
The only trouble is that the comment is wrong: the filename needs to be "plcmacro?.mac", not just "macro?.mac".

To further complicate matters, I think some newer CNC12 versions (maybe just for Acorn) require that the files be renamed "mpgmacro?.mac" instead. However, for closed-loop systems, CNC12 v4.20 still uses "plcmacro?.mac".

The macro files are plain CNC code (not PLC code). These functions only work when CNC12 is idle. You cannot activate a CNC macro through the wireless MPG while you are running a CNC program. In this regard, they are very similar to M functions called with Aux keys via Parameters 188-199. The only notable difference is that macros triggered by the wireless MPG proceed without requiring a press of the Cycle Start button.
repauli1
Posts: 156
Joined: Thu Jul 09, 2020 9:50 pm
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Wmpg macros?

Post by repauli1 »

Thanks, I will give this a shot
cnckeith
Posts: 7164
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: Wmpg macros?

Post by cnckeith »

yes, in acorn we changed the name to mpgmacro_.mac (located in cncm\system) so user could understand what the file was for by the name. i'll have the plc programmers update the names in the comments on the servo side.
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