Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Mortenx on December 08, 2020, 04:46:50 AM

Title: Mach3 custom macro with value question
Post by: Mortenx on December 08, 2020, 04:46:50 AM
Hi all,

I have a lathe with 2 vfd's one for the spindle and one for a livetool, I use a custom macro M133 to activate an output that then goes via modbus to the livetool inverter, the speed for the livetool I take from the spindle DRO, as the spindle does not work while in C axis mode, I have an electrical clutch that connects a nema 34 to the C-axis - all this works just fine.

But, the spindle have a max rpm, and the livetool a higher rpm, is there anyway to say I could do something like this:

M133 P2500

that "P" value could be another rpm register, or just take that value to the M133 and set in in there?


Regards Morten
Title: Re: Mach3 custom macro with value question
Post by: TPS on December 08, 2020, 05:26:07 AM
RPM = Param1()

within the macro will read the value from P Parameter

if you call

Code: [Select]
M133 P2500

and in the macro:
Code: [Select]
RPM = Param1()

the RPM will be 2500

see:  www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf
Title: Re: Mach3 custom macro with value question
Post by: Mortenx on December 08, 2020, 10:57:20 AM
Hi,

Working, thanks again TPS ;)

Regards Morten