Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: giannis121 on January 20, 2011, 08:50:51 AM

Title: Spindle OFF and DoOemButton(110) problem
Post by: giannis121 on January 20, 2011, 08:50:51 AM
I face a problem with spindle speed as following:

I have made a macro "M900" in the middle of a program, which includes:
If GetOemLed(164) then
      DoOemButton(110)
End If
which means, if the CW rotation LED is active, switch off spindle.

The spindle is switched OFF, but the Oem 164 LED is still ON.

It goes OFF only at the end of the program when "Turn OFF spindle" under "General config" is selected.

My problem is that i want to start and stop it during the program flow,
by reading the 164 Oem LED.

Exaclty the same happens if i read the OemLed(11) instead of (164).

Do you have any ideas?

Thanks,
giannis
Title: Re: Spindle OFF and DoOemButton(110) problem
Post by: Overloaded on January 20, 2011, 09:32:44 AM
If GetOemLed(11) Then
      Code "M5"
End If
 
This might work for you Giannis.
Try with caution, I'm guessing.
Russ
Title: Re: Spindle OFF and DoOemButton(110) problem
Post by: Hood on January 20, 2011, 09:38:59 AM
Try having DoSpinStop() instead of the DoOemButton(110)

Hood

OOPs RC got there first, if his doesnt work try mine :)
Title: Re: Spindle OFF and DoOemButton(110) problem
Post by: Overloaded on January 20, 2011, 09:52:22 AM
I notice (screen4) that 110 is a OEM Code Funtion under the spindle toggle button, not an OEM Button.
110 in the button list is "Spindle CW, reset THC height".
Would both do the same thing ?
How would you (can you) call a Function code in the script ?
Thanks Hood
Title: Re: Spindle OFF and DoOemButton(110) problem
Post by: Hood on January 20, 2011, 10:01:01 AM
Should be the same thing Russ, will have to check the list later.

Hood
Title: Re: Spindle OFF and DoOemButton(110) problem
Post by: Overloaded on January 20, 2011, 10:09:21 AM
Could also use LED 852, provided CW is set up to use Output 1.
I dont see GetOemLed(164) anywhere.
Where did it come from ?
Russ
Title: Re: Spindle OFF and DoOemButton(110) problem
Post by: Overloaded on January 20, 2011, 10:15:23 AM
ahh.....found it in Bretts list,
Thanks
Title: Re: Spindle OFF and DoOemButton(110) problem
Post by: giannis121 on January 20, 2011, 12:43:47 PM
Thank you for the posts!
I will try and let you know soon.
Title: Re: Spindle OFF and DoOemButton(110) problem (SOLVED)
Post by: giannis121 on January 21, 2011, 03:31:21 AM
OK finally M5 and DoSpinStop() work,
but only if they are in a seperate command.
Does not work if i call M5 from other macro (code "M5").
But anyway, i do what i want now,
thank you for the posts!