Hello guys,
I am new to plasma CNCs and a total idiot in coding. However, I was wondering, can I edit the M5 macro to create a delay before Mach3 switches off the torch relay?
From what I have researched, would one of these be OK:
Sleep(1000)
DospinStop()
OR
While(IsMoving())
DospinStop()
OR
While(IsMoving())
Sleep(1000)
DospinStop()
For some reason I feel like I am wrong in all!
Any help would be appreciated guys.
THanks
Dim
Macro M5
-
- 4.5 Star Elite Contributing Member
- Posts: 1823
- Joined: Mon Jun 12, 2017 6:43 pm
Re: Macro M5
if you go to the config and ports and pins and then spindle tab you can just add a delay there.... no editing required
-
- 1.5 Star Member
- Posts: 37
- Joined: Wed Jul 29, 2020 10:42 am
Re: Macro M5
I assume you are referring to the CW Delay Spin DOWN... I ll give it a try.
But in any case, just for learning sake, would any of the above coding I mention work??
Thanks
Dim
But in any case, just for learning sake, would any of the above coding I mention work??
Thanks
Dim
-
- 4.5 Star Elite Contributing Member
- Posts: 1823
- Joined: Mon Jun 12, 2017 6:43 pm
Re: Macro M5
Ok, this will do what I think you want to do which is to wait 1 second, and then stop....
Motion would have already stopped by the time an M5 Macro runs given it is a non-synchronous macro (i.e. motion pauses before it is implemented).
This one will just stop the spindle / open the spindle relay (given motion will stop anyway before an M5 is called)
This one is the same as the first one..... because M5 is a non-synchronous macro motion has to stop / pause before it runs..... so while (is moving()) should do nothing or be of no benefit to the macro code.
Sleep obviously puts the macro to sleep for 1000mSec (1sec) and then stops the spindle / opens the spindle relays (M4/M3, whichever are toggled).