Hello Guest it is March 28, 2024, 08:12:18 PM

Author Topic: skipping lines  (Read 745 times)

0 Members and 1 Guest are viewing this topic.

Offline Bill_O

*
  •  563 563
    • View Profile
skipping lines
« 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

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: skipping lines
« Reply #1 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?
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!