Bob - thanks. I got to play with the spindle a little more today and it works as you said. The problem I am having is I want to position the laser at the 0,0 point of my work piece. Until I run the g code file Mach 4 does not have a laser setting so I can not turn the laser on using the spindle control to center the work piece. Is there any way I can make a button that turns on the spindle to a known setting?
Yes, there are a couple of ways to do this.
(1) In my test screen sets I've added a DRO near the "Spindle CW" button. I set the "DRO Code" to "Spindle RPM", and set the "Format" field to "%.1f" which displays 1 fractional digit. I don't remember why I did that as I don't need that kind of resolution. Setting to "%.0f" will display no fractional decimal digits.
or...
(2) Add a button. Then edit the button's "Left Up Script" to something like this (UNTESTED!!!!):
local inst = mc.mcGetInstance();
local rpm = 1000; -- Set this to the actual RPM you want as your starting point
mc.mcSpindleSetCommandRPM( inst, rpm );
mc.mcSpindleSetDirection( inst, 1 ); -- 1 == forward, 0 == off, -1 == reverse
The other problem is with eStop. Sometimes it turns off the spindle and sometimes it does not. The LED on Mach 4 even shows the spindle on when it does not turn off the spindle. I am using Mach 4 (not the latest but one rev back) and PMDX 410 with a PMDX 132 breakout board.
Rats. I don't know *WHY* I thought you had an ESS. I could have sworn I read that earlier in this thread, but (now) obviously not. Well then, I guess in all fairness I need to say that maybe this is an issue in OUR plug-in. So I'm going to get niggly here:
- Exactly which version of Mach4 are you running
- Exactly which versions of our plug-in are you running
- Which LED on the Mach4 screen is on when the spindle is still on during EStop?
- Which Mach4 output signal do you have controlling the spindle on/off (ex "Spindle On" or "Spindle Fwd")?
- Which SmartBOB output pin do you have that Mach4 signal mapped to (ex "Pin1", "Pin11", etc.)?
I'm sure I'll have more questions later, but this is a start.
Bob