Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: Bill_O on August 10, 2010, 07:45:41 PM
-
I have a small program that runs when a button is pushed. Every time I run this program the pokeys is no longer seen. Here is the program. Any ideas?
SetUserLED (1220, 1)
ActivateSignal(Output3) 'turn on chiller
Sleep (2000)
ActivateSignal(Output2) 'turn on spindle
Code "S18000"
Sleep (120000)
Code "S27000"
Sleep (120000)
Code "S36000"
Sleep (120000)
DeActivateSignal(Output2) 'turn off spindle
Sleep (10000)
DeActivateSignal(Output3) 'turn off chiller
SetUserLED (1220, 0)
Bill
-
Try this code, not sure it will be better but worth a try
SetUserLED (1220, 1)
ActivateSignal(Output3) 'turn on chiller
Sleep (2000)
ActivateSignal(Output2) 'turn on spindle
Code "S18000"
while ismoving()
Code "G4 P1200"
wend
Sleep (1000)
Code "S27000"
while ismoving()
Code "G4 P1200"
wend
Sleep (1000)
Code "S36000"
while ismoving()
Code "G4 P1200"
wend
Sleep (1000)
DeActivateSignal(Output2) 'turn off spindle
Sleep (1000)
DeActivateSignal(Output3) 'turn off chiller
SetUserLED (1220, 0)
Graham
-
Graham,
It just ignores the g4 pauses. That is why I started using sleep commands. I tried it anyway and it did not pause at the g4 commands.
Thanks for the suggestion and I will gladly try anything. I have 2 machines to get out at the end of next week and both have a pokeys on them.
Bill
-
OK, so lets try it a different way.
Put this code into the M3.m1s macro in the profile you are using, remove the current dospin() code :-
You can also put this in the M4.m1s too
SetUserLED (1220, 1)
ActivateSignal(Output3) 'turn on chiller
ActivateSignal(Output2) 'turn on spindle
Then put this into the M5.m1s macro as above :-
DeActivateSignal(Output2) 'turn off spindle
DeActivateSignal(Output3) 'turn off chiller
SetUserLED (1220, 0)
Then put this into a sub program in the subs folder of your profile, call it "warmup.tap" :-
(warmup.tap)
S18000
G4 P1200
S27000
G4 P1200
S36000
G4 P1200
M99
Your calling code would look like this :-
M3 (turn on chiller and spindle)
M98 (warmup.tap) (call spindle warm up sub)
M4 (turn off chiller and spindle)
M30
Graham
-
Graham,
It tells me " Cannot load first file "
Exactly how do you put the m98 and file to call
-
also, it does go in the Mach3/Subroutines folder doesn't it?
-
Give it a try this way and see what happens
SetUserLED (1220, 1)
Sleep(100)
ActivateSignal(Output3) 'turn on chiller
Sleep (1000)
ActivateSignal(Output2) 'turn on spindle
Sleep(1000)
Code "S18000"
sleep(10)
Code"G4 P1200"
While Ismoving()
Sleep(1000)
wend
Code "S27000"
Sleep(10)
Code"G4 P1200"
While Ismoving()
sleep(1000)
Wend
Code "S36000"
sleep(10)
Code"G4 P1200"
While Ismoving()
Sleep(1000)
Wend
DeActivateSignal(Output2) 'turn off spindle
Sleep (1000)
DeActivateSignal(Output3) 'turn off chiller
Sleep(1000)
SetUserLED (1220, 0)
Sleep(100)
end