Hello Guest it is April 23, 2024, 06:44:14 PM

Author Topic: Mach3 custom macro with value question  (Read 664 times)

0 Members and 1 Guest are viewing this topic.

Mach3 custom macro with value question
« 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

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Mach3 custom macro with value question
« Reply #1 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
« Last Edit: December 08, 2020, 05:28:39 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach3 custom macro with value question
« Reply #2 on: December 08, 2020, 10:57:20 AM »
Hi,

Working, thanks again TPS ;)

Regards Morten