Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: ozwes007 on February 23, 2025, 05:29:09 AM

Title: Line reading in a macro in Mach 3
Post by: ozwes007 on February 23, 2025, 05:29:09 AM
I’m am writing a macro to perform a function and need it to read in the rest of the line to capture a value.
Eg. M103 V45
The macro M103 has to read in the 45 as a value to do a math function. The V could be left off.
Too many years of not using Mach 3. And no I don’t wish to move to Mach 4 for this project atm.
Any help would be appreciated.
Title: Re: Line reading in a macro in Mach 3
Post by: Graham Waterworth on February 23, 2025, 12:10:46 PM
In your Gcode set #1000 = 45 before calling M103

Then in your macro V_Var = GetParam(1000)

Just do the M103 on its own

Title: Re: Line reading in a macro in Mach 3
Post by: ozwes007 on February 24, 2025, 03:31:15 AM
Thanks, I will give that a try.