Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: kevlar129bp on April 23, 2021, 06:48:06 PM

Title: Set G01 feedrate from a macro...
Post by: kevlar129bp on April 23, 2021, 06:48:06 PM
Hello all,

It's been a long time. I hope everyone is well. I've got a question regarding setting feedrates (as I'm sure you gathered from the subject).
Here's what I've got going on:
I've got a Visual Studio program managing a database of feeds and speeds based on material selection.
From Mach3, you select the material you are cutting and the feedrate is served from the database (no problem here).

Let's paint a picture of what I'm trying to do:

-----------------------------------------
G Code example:

G00X0.Y0.
M03G04P0.5
G01X10.M801
Y10.
X0.
Y0.
M05
------------------------------------------

------------------------------------------
Here's what I've tried in the "M801.m1s" file:

Code ("F50.")   <---- No dice, feed doesn't change

SetFeedRate(50 / 60)   <---- No dice, feed doesn't change

SetOEMDRO(818, 50)   <---- No dice, feed doesn't change

SetParam("FeedRate", 50)   <---- Haven't tried this?
--------------------------------------------

Any thoughts on what I'm doing wrong? It's driving me nuts!

Thanks all,
Chris

Title: Re: Set G01 feedrate from a macro...
Post by: Graham Waterworth on April 23, 2021, 07:47:10 PM
Are you sure the M801.m1s is being run?
Title: Re: Set G01 feedrate from a macro...
Post by: kevlar129bp on April 23, 2021, 07:54:01 PM
Hey Graham,

Thanks for the reply. Hmmm, I can't think of why it wouldn't? I guess I could try it from MDI? Any other way to test it?
The macro is definitely in the correct folder, checked that, like a million times  :)

Thanks for your thoughts,
Chris
Title: Re: Set G01 feedrate from a macro...
Post by: Graham Waterworth on April 24, 2021, 11:30:46 AM
What happens if you issue the M801 before the G01 line, I am not sure just when the M code is executed but I think its after the move commands.

You can do a message in the M801 that will show in the status line.

Message("In Here")
Sleep(50)


Title: Re: Set G01 feedrate from a macro...
Post by: kevlar129bp on April 24, 2021, 08:36:21 PM
Sorry for the delay, I've been watching my Dogecoin instead of machining  ;D The message idea sounds awesome. I'll give it a run when I get a second.

Thanks a bunch,
Chris