Do you actually control your spindle from Mach?
Hood
Yes, it doesn't work like I would hope... but it does work.
OK, this is my new M3 macro:
1 SpinCW = GetRPM() '
I use SpinCW to test how fast the spindle needs to go2 ActivateSignal(OUTPUT1) '
This OUTPUT enables my spindle drive, VFD3
4 If SpinCW < 901 Then '
Low gear. My spindle gear goes from 0-900 for low then 901-5000 for high5 Call LowGear '
Calls sub program LowGear6 End If
7
8 If SpinCW > 900 Then '
High gear9 Call HighGear '
Calls sub program HighGear10 End If
11
12
13 Sub LowGear '
LowGear sub program14 ActivateSignal(OUTPUT8)'Low Gear '
Engage the Low gear solenoid15
16 SetPulley(1) '
Set pulley to Pulley #117
18 While IsActive(OEMTRIG2) = False '
This is the INPUT, switch, for low gear19 Sleep 10
20 Wend
21
22 Call SpinSpindle '
Call sub Spinspindle23
24 End Sub
25
26 Sub HighGear '
HighGear sub27 ActivateSignal(OUTPUT7)'High Gear '
Engage the High gear solenoid28
29 SetPulley(2) '
Set pulley to Pulley #230
31 While IsActive(OEMTRIG1) = False '
This is the INPUT, switch, for high gear32 Sleep 10
33 Wend
34
35 Call SpinSpindle '
Call sub Spinspindle36
37 End Sub
38
39
40 Sub SpinSpindle '
SpinSpindle sub program41
42 DoSpinCW() '
Spin spindle CW43
44 End Sub
45
46 Exit Sub
OK, so when I step through this everything seems to work fine, I step through it with the e-stop on. The pulley changes and INPUTS and OUTPUTS seem fine. I save it then MDI M3S100, that would choose LowGear. If the Pulley under the settings tab is already one it works fine, but if it's two I get the pulley error. It seems to be running the macro so fast that it's not running every command. Is it possible that only certain commands work in the M3 macro? I changed the pulley manually, changed the DRO, to two and ran in MDI M3S100, the spindle started to spin up before the gear was fully engaged. REALLY bad sound... let me tell you

.
If anyone has a clue on why this code isn't working please let me know. I'm at a stop tell I can figure this out.
Thanks,
Aero
P.S. Helping at my son's little league practice + watching Bones on Netflix yesterday, made me have the ability to try this all over again today
