Hello Guest it is March 29, 2024, 11:58:31 AM

Author Topic: program causing pokeys to quit  (Read 4034 times)

0 Members and 1 Guest are viewing this topic.

Offline Bill_O

*
  •  563 563
    • View Profile
program causing pokeys to quit
« 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

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: program causing pokeys to quit
« Reply #1 on: August 11, 2010, 03: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
Without engineers the world stops

Offline Bill_O

*
  •  563 563
    • View Profile
Re: program causing pokeys to quit
« Reply #2 on: August 11, 2010, 06: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

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: program causing pokeys to quit
« Reply #3 on: August 12, 2010, 03: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
Without engineers the world stops

Offline Bill_O

*
  •  563 563
    • View Profile
Re: program causing pokeys to quit
« Reply #4 on: August 12, 2010, 10:44:27 AM »
Graham,

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

Offline Bill_O

*
  •  563 563
    • View Profile
Re: program causing pokeys to quit
« Reply #5 on: August 12, 2010, 10:45:21 AM »
also, it does go in the Mach3/Subroutines folder doesn't it?

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: program causing pokeys to quit
« Reply #6 on: August 12, 2010, 12:22:36 PM »
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, 12:27:08 PM by BR549 »