# Directives Available in gSender?

**URL:** <https://forum.sienci.com/t/directives-available-in-gsender/10115>\
**Category:** ❓ Question\
**Created:** [October 24, 2023, 3:03pm UTC](https://forum.sienci.com/t/directives-available-in-gsender/10115 "2023-10-24T15:03:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CrookedWoodTex](https://forum.sienci.com/user_avatar/forum.sienci.com/crookedwoodtex/32/10446_2.png) [@CrookedWoodTex](https://forum.sienci.com/u/CrookedWoodTex)\
**Post date:** [October 24, 2023, 3:03pm UTC](https://forum.sienci.com/t/directives-available-in-gsender/10115/1 "2023-10-24T15:03:59Z")

</div>

At one time or other, gSender balked or choked or errored on the CNCjs directive **%wait**.

I don’t find any complaints from users of macros with **%wait** in their macros, but since **%wait** looks like the text of a _variable_ how would one know if it was just being ignored?

I’ve looked at the console and found that with gSender output I get G4 P0.5 instead of where I think **%wait** should be. I use G4 P0.5 instead of **%wait**.

So, the question is for @chrismakesstuff or @KGN , is **%wait** in a macro actually doing anything at all?

---

<div class="post-metadata">

**Author:** ![NeilFerreri](https://forum.sienci.com/user_avatar/forum.sienci.com/neilferreri/32/1959_2.png) [@NeilFerreri](https://forum.sienci.com/u/NeilFerreri)\
**Post date:** [October 24, 2023, 4:30pm UTC](https://forum.sienci.com/t/directives-available-in-gsender/10115/2 "2023-10-24T16:30:55Z")

</div>

> [@CrookedWoodTex](#):
>
> is **%wait** in a macro actually doing anything at all?

Yes.  
It’s `G4 P0.5`

I think it was carried over to cncjs from bcnc.

> <https://github.com/Sienci-Labs/gsender/blob/8c24c969f59c8fd8f93cf5a8e8bbd4fdea63c759/src/server/controllers/Grbl/GrblController.js#L264-L266>

---

<div class="post-metadata">

**Author:** ![CrookedWoodTex](https://forum.sienci.com/user_avatar/forum.sienci.com/crookedwoodtex/32/10446_2.png) [@CrookedWoodTex](https://forum.sienci.com/u/CrookedWoodTex)\
**Post date:** [October 24, 2023, 4:39pm UTC](https://forum.sienci.com/t/directives-available-in-gsender/10115/3 "2023-10-24T16:39:55Z")

</div>

@NeilFerreri Thanks, Neil, but at one time we were thinking that **%wait** was not just waiting for a specified time.

We thought it was waiting for the buffer to empty, before moving on to the next line.

Is that what G4 is doing?

---

<div class="post-metadata">

**Author:** ![NeilFerreri](https://forum.sienci.com/user_avatar/forum.sienci.com/neilferreri/32/1959_2.png) [@NeilFerreri](https://forum.sienci.com/u/NeilFerreri)\
**Post date:** [October 24, 2023, 5:19pm UTC](https://forum.sienci.com/t/directives-available-in-gsender/10115/4 "2023-10-24T17:19:56Z")

</div>

That was the point of the G4. It’s a dwell command. Basically tells the machine to just hang out for a half second. In that specific case, to allow for buffer to catch up or for any EEPROM writes to complete.  
Weird stuff used to happen if we weren’t adding those dwells. Development has come a long way since the early cncjs days though.

---

<div class="post-metadata">

**Author:** ![KGN](https://forum.sienci.com/letter_avatar_proxy/v4/letter/k/c77e96/32.png) [@KGN](https://forum.sienci.com/u/KGN)\
**Post date:** [October 25, 2023, 12:39am UTC](https://forum.sienci.com/t/directives-available-in-gsender/10115/5 "2023-10-25T00:39:14Z")

</div>

I think a lot of the “weird stuff” is just an artifact of the 8 bit board. We’re noticing as we test the new (32 bit) board how fast it handles things like probe touches/pin status/EEPROM changes compared to the OG longboard and have been tweaking areas where we had to wait and can (optionally) no longer wait - like our probe routines.

Anyways, Neil has covered the original question well enough - it looks like a variable but is replaced with a dwell when run in macros/program events.

---

<div class="post-metadata">

**Author:** ![chrismakesstuff](https://forum.sienci.com/user_avatar/forum.sienci.com/chrismakesstuff/32/10759_2.png) [@chrismakesstuff](https://forum.sienci.com/u/chrismakesstuff)\
**Post date:** [November 5, 2024, 3:49am UTC](https://forum.sienci.com/t/directives-available-in-gsender/10115/6 "2024-11-05T03:49:17Z")

</div>

Closed on November 5, 2024, 3:49am UTC


