Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Bill_O on March 15, 2019, 07:45:05 AM

Title: skipping lines
Post by: Bill_O on March 15, 2019, 07:45:05 AM
Attached is a macro I made.
If I step through in the editor it works fine.
The first time I run it it works fine.
If I run it again it skips the second G28.1.
If I restart Mach it runs fine the first time again and so on.
It has a lot of commented out things that I have been trying so please ignore them.

Bill
Title: Re: skipping lines
Post by: Chaoticone on March 15, 2019, 09:22:44 AM
Comment out all of the sleeps and coroutine.yields.
Replace all of the GcodeExecute calls with GcodeExecuteWait. Another option may be to just create a single string and execute it in exact stop mode.

Look in the API help doc and compare GcodeExecute and GcodeExecuteWait. They have pretty good explanations.

Also, the coroutine.yield. You can't just place it anywhere and expect it to work. It's useless without the rest of the bits that go with it. Where are you creating this coroutine you are yielding? Where are you resuming this coroutine?