Hello Guest it is April 23, 2024, 04:05:16 AM

Author Topic: Coroutine or executewait  (Read 744 times)

0 Members and 1 Guest are viewing this topic.

Offline Stuart

*
  •  311 311
    • View Profile
Coroutine or executewait
« on: August 02, 2019, 02:27:11 PM »
I have a need to execute a couple of lines of gcode and then run a script

Is it best to use a coroutine.wait or mc.mcCntl(inst,”Gxx”)

What i am asking is which is the safer to ensure that the gcode is completed

I do know how to implement the coroutine in screen load and the plc , and have it working as such


Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Coroutine or executewait
« Reply #1 on: August 02, 2019, 06:03:17 PM »
It all depends on what your doing. If it can be done with mc.mcCntlGcodeExecuteWait() then no reason not to use it. Technically I guess it would be the safest. But using a coroutine is perfectly fine too as long as it is implemented correctly.
;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!

Offline Stuart

*
  •  311 311
    • View Profile
Re: Coroutine or executewait
« Reply #2 on: August 03, 2019, 02:52:04 AM »
Thanks for the input

As I said I have it working as a coroutine ,but I wondered if I have over complicated it