Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: Bit79 on December 12, 2007, 07:27:06 AM

Title: VB and spindle
Post by: Bit79 on December 12, 2007, 07:27:06 AM
Hi,
I'm trying to realize some macros to manage better my cnc, but I find some difficult.
In particular in a VB macro I need to detect if the spindle is on or off, and execute the macro only if the spindle in off, or ignore it if the spindle is on, but I don't know which parameter I have to test. How can I do it?

Thank you!
Title: Re: VB and spindle
Post by: poppabear on December 12, 2007, 04:57:21 PM
'spindle on check macro
Sub Main()

If GetOEMLED(116) then
Message("spindle is running cannot execute macro.")
Exit Sub
Else
****Put in the code for your macro here****
End If

End Sub 
Main

'Scott
Title: Re: VB and spindle
Post by: Bit79 on December 13, 2007, 04:41:30 AM
Thank you very much.
I tried and it work good.

I also tried with:

If GetOEMLED(11) then....

and It work likewise. What's the difference between GetOEMLED(11) and GetOEMLED(116)?