Page 1 of 1

Wmpg macros?

Posted: Sun Dec 26, 2021 5:38 pm
by repauli1
Which manual covers the macros in the Wireless MPG Pendant? Cannot locate info.
Thanks in advance.

Re: Wmpg macros?

Posted: Sun Dec 26, 2021 9:53 pm
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.

Re: Wmpg macros?

Posted: Mon Dec 27, 2021 1:15 pm
by repauli1
Thanks, I will give this a shot

Re: Wmpg macros?

Posted: Wed Jan 05, 2022 4:42 pm
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.