Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 06:40:01 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  program causing pokeys to quit
Pages: 1   Go Down
Print
Author Topic: program causing pokeys to quit  (Read 420 times)
0 Members and 2 Guests are viewing this topic.
Bill_O
Active Member

Offline Offline

Posts: 104



View Profile
« on: August 10, 2010, 06: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
Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,665


West Yorkshire, England



View Profile WWW
« Reply #1 on: August 11, 2010, 02:54:38 AM »

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
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
Bill_O
Active Member

Offline Offline

Posts: 104



View Profile
« Reply #2 on: August 11, 2010, 05:24:00 PM »

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
Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,665


West Yorkshire, England



View Profile WWW
« Reply #3 on: August 12, 2010, 02:31:57 AM »

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
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
Bill_O
Active Member

Offline Offline

Posts: 104



View Profile
« Reply #4 on: August 12, 2010, 09:44:27 AM »

Graham,

It tells me " Cannot load first file "
Exactly how do you put the m98 and file to call
Logged
Bill_O
Active Member

Offline Offline

Posts: 104



View Profile
« Reply #5 on: August 12, 2010, 09:45:21 AM »

also, it does go in the Mach3/Subroutines folder doesn't it?
Logged
BR549
Active Member

Offline Offline

Posts: 2,553


View Profile
« Reply #6 on: August 12, 2010, 11:22:36 AM »

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

« Last Edit: August 12, 2010, 11:27:08 AM by BR549 » Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!