Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: axilleas on July 21, 2006, 06:11:13 AM

Title: stop waiting G4
Post by: axilleas on July 21, 2006, 06:11:13 AM
Hello

I am using a script for a M function with G4 Pxx (wait xx seconds).Thats fine

Then I want by pressing a button to stop waiting and continue executing next line.
Any help?

Thanx
Title: Re: stop waiting G4
Post by: axilleas on July 21, 2006, 09:00:58 AM
It's me again

Accidentally I found that the button I asked above is the "Run" button. :)
BUT
I created a new vb script button with dobutton (0) and some other lines. When I press the green play button in  the script editor it works fine (NOT step by step). When I close the editor and press the button it is not the same!! (feedrate gets equal to x position, the movement is not the next line.... ???)

Thanx
Title: Re: stop waiting G4
Post by: Graham Waterworth on July 21, 2006, 02:12:50 PM
Why can't you use an M0 (Mzero) instead of a G4 Pxx, M0 will wait until you press the start button.

Graham.
Title: Re: stop waiting G4
Post by: axilleas on July 22, 2006, 07:24:37 AM
There is a userDRO with the time xx (G4 Pxx) given by the user. This is the preheat time of an oxy flame.
Usually the user set this userDRO before start cutting without knowing if this time is ok. Usually he sets a high number. During preheat user can see the flame and push a button when he thinks that the time is ok. The time from the start of the preheat is recorded in this userDRO so next time preheat will be ok.
So M0 is not an option.

Thanx
Title: Re: stop waiting G4
Post by: axilleas on July 24, 2006, 04:20:43 AM
Here is the button script

c=Timer()
totaltime=(c-getuserdro(1002))
setuserdro(1000,totaltime)   
dooembutton(1000)   


1002 userDRO is the time from the beginning of the preheat. I use M18 to fill 1002 up.

b=Timer()
setuserdro(1002,b)
preheat=getuserdro(1000)
ActivateSignal(Output4)
code ("G4 P" & preheat)


totaltime is the the xx (G4 Pxx) time
dooembutton(1000)=dobutton(0) I think. I tried them both.

As I have described when I use the normal Run button it stops waiting and continue with next line. When I use this button the calculations in the first 3 lines are done correctly but then the feedrate gets equal to Xposition and it moves to a no sense place. When it reaches that place it continues as if it has done next line.
Appart from the fact that if I have open the script editor and I "play" the script from within the editor, it works fine, it works fine the for the second or third curve.
For example:

N0000 (Filename: Drawing1.tap)
N0010 (Post processor: Copy of Mach2.post)
N0020 (Date: 24/7/2006)
N0030 G21 (Units: Metric)
N0040 G40 G90
N0050 F1
N0060 (Part: Drawing1)
N0070 (Process: No offset 0, Mill/Router, 0,1 mm diameter, 0 mm Deep)
N0080 M6 T0  (Mill/Router, 0,1 mm diameter)
N0090 G43 H0
N0100 G00
N0110 M04
N0120 X180.3516 Y119.7404
N0130 (Part: Drawing1 Duplicate 1)
N0140 M18
N0150 G02 X180.3516 Y119.7404 I-67.4337 J0.0000 F3000.0
N0160 (Process: No offset 0, Mill/Router, 0,1 mm diameter, 0 mm Deep)
N0170 M17
N0180 G00 X170.1790 Y266.9916
N0190 (Part: Drawing1 Duplicate 2)
N0200 M18
N0210 G02 X170.1790 Y266.9916 I-67.4337 J0.0000
N0220 (Process: No offset 0, Mill/Router, 0,1 mm diameter, 0 mm Deep)
N0230 M17
N0240 G00 X306.6313 Y199.9025
N0250 (Part: Drawing1 Duplicate 3)
N0260 M18
N0270 G02 X306.6313 Y199.9025 I-67.4337 J0.0000
N0280 (Process: No offset 0, Mill/Router, 0,1 mm diameter, 0 mm Deep)
N0290 M17
N0300 G00 X388.5027 Y82.7810
N0310 M18
N0320 G02 X388.5027 Y82.7810 I-67.4337 J0.0000
N0330 M05
N0340 G00
N0350 G00 X0 Y0
N0360 G49
N0370 M05 M30

If I push the button while waiting in N0140  >:(
If I push it during N0200, N0260 or N0310 it works well  ???

Thanx
Title: Re: stop waiting G4
Post by: axilleas on July 24, 2006, 04:44:55 AM
I also found out the "no sense" movement. In G is

G01 X119.7404 Y112.9179 F180.3516

which is not so much "no sense".

Normal line is
G02 X180.3516 Y119.7404 I-67.4337 J0.0000 F3000.0

Y gets X
I gets Y (180.3516-67.4337=119.7404)
and X get F

I though that while N0150 is the first "cutting" line a problem occurs. So I put a G01 F3000 in the beginning but it did not work.

I am very sorry for bothering you so much

Thanx
Title: Re: stop waiting G4
Post by: axilleas on July 25, 2006, 06:04:01 AM
It is exactly what is being discussed here

http://groups.yahoo.com/group/mach1mach2cnc/message/25060

Thanx
Title: Re: stop waiting G4
Post by: Brian Barker on July 25, 2006, 07:34:51 AM
Hello,
You are looking to change the dwell time... Hmmmm I think the best way to change to dwell time with a DRO is to use the M3 and M5 macros :) Much the same way that you have done here:

c=Timer()
totaltime=(c-getuserdro(1002))
setuserdro(1000,totaltime)   
dooembutton(1000)   

1002 userDRO is the time from the beginning of the preheat. I use M18 to fill 1002 up.

b=Timer()
setuserdro(1002,b)
preheat=getuserdro(1000)
ActivateSignal(Output4)
code ("G4 P" & preheat)

totaltime is the the xx (G4 Pxx) time
dooembutton(1000)=dobutton(0) I think. I tried them both.

I don' t get what it is that you are trying to do :( If it was e and I needed to change the Pre heat time I woudl do the following
'M3
preheat=getuserdro(1000)
DoSpinCW()
code ("G4 P" & preheat)

and to turn off

'M5
DoSpinStop()

Sorry i don't see what you need :(

the other thing that you are talking about :

"I also found out the "no sense" movement. In G is
G01 X119.7404 Y112.9179 F180.3516"

What is a "No Sense" Move??? are you talking about a nonprobe move?

we will get you fixed up
Thanks
Brian
Title: Re: stop waiting G4
Post by: axilleas on July 26, 2006, 02:51:27 AM
Sorry for not making myself clear. :-[

I use a DRO with dwell time. Instead of M3 I use M18. I do exactly what you said and it is ok.
Your M3 is

preheat=getuserdro(1000)
DoSpinCW()
code ("G4 P" & preheat)

My M18 is

b=Timer()
setuserdro(1002,b)
preheat=getuserdro(1000)
ActivateSignal(Output4)
code ("G4 P" & preheat)

The only difference in that you use DoSpinCW() and I use ActivateSignal(Output4). I also use userDRO 1002 as a public var to store the exact time that preheat was started. I want this time because I have a button with the following script.

c=Timer()
totaltime=(c-getuserdro(1002))
setuserdro(1000,totaltime)   
dooembutton(1000)   

When the user presses THE button during waiting time (dwell) I calculate the "totaltime" var which is the time from the beginning of the preheat and the time THE button is pressed. Then I store this time to the userDRO 1000. This time will be used the next time from M18.

ALL these works fine.

The problem I have is with the DoButton(0) and the equivalent DoOEMButton(1000).

During dwell (G4 Psomething) time you can cancel waiting by pressing the Run button. I put dooembutton(1000) in my button so after the calculation of totaltime the movement to be start. This also works well in all occasions except form one. I have to explain it to you with a small example

N01 G00 X100 Y100
N02 M18
N03 G01 X250 Y200 F3000
N04 M17
N05 G00 X200 Y100
N06 M18
N07 G01 X350 Y200
N08 M17
N09 ....

I have the script editor open with the script of THE button. I press the green play button inside the editor during dwell time in line N02 and it work fine.
I also press it during N06 line and it also works fine. Now I close the editor window.
If I press THE button during N02 "totaltime" calculations are done well but the movement is not G01 X250 Y200 F3000 it is G01 X200 Y0 F250.  :o (Feedrate is the X, X is Y and Y is 0)
If I press the button during N06 then everything is OK. It is OK even if I had already pressed THE button once in N02 or for the first time.

I am again very sorry for not making myself clear. Maybe is my English. It is not my mother language.
Bye from Greece

Thanx
Title: Re: stop waiting G4
Post by: Brian Barker on July 27, 2006, 10:27:46 PM
You did well !

Try to use DoOEMButton(288) To cancel the Dwell. This should work :)

Best of luck
Brian
Title: Re: stop waiting G4
Post by: klmark on March 11, 2007, 10:34:27 AM
hi guys
how would i get contact with the user name axilleas he talk about dwell features that i realy need and would like but i need more help i am new to mach 3 Thank you ley me know
Title: Re: stop waiting G4
Post by: axilleas on March 12, 2007, 08:13:44 AM
just pm me :)
Title: Re: stop waiting G4
Post by: klmark on March 12, 2007, 09:47:31 AM
Hi axilleas
I am Mark   I am new to a mack licence user on the dwell post you guys talk what i want on my cnc machine I use a flam cutter and plan to add on a plasma but a the dwell feature i want z axis to plunge down preheat until i comment the machine to start the torch and start moving the x y axis on the toolpath i know it can be done because you guys talk about it in the forums so Please let me know how to do it it would be greatly appreciate
Title: Re: stop waiting G4
Post by: Hood on March 12, 2007, 02:03:24 PM
Simplest way would be to put M1 in the code where you want it to stop, when its ready to move again all you do is press start, If you knew the exact time you wanted a pause you could put G4 P** (** being time in seconds) and after that time had elapsed it would continue.
Hood
Title: Re: stop waiting G4
Post by: klmark on March 12, 2007, 02:12:09 PM
would i have to add M1 Manuel on every plunge If that is so there has to be a better way
Title: Re: stop waiting G4
Post by: Hood on March 12, 2007, 02:19:32 PM
Ho many plunges/pauses would you be looking at in a typical programme?
How do you write the programme, if its with CAM it may be possible to get the CAM to add it automatically.
Hood
Title: Re: stop waiting G4
Post by: klmark on March 12, 2007, 02:46:32 PM
on a flamcutting a guy dose quiet a bit of plunging as far as the cam i plan to use lazycam i appreciate our feedback Thank you
Title: Re: stop waiting G4
Post by: Hood on March 12, 2007, 04:59:40 PM
not sure if it would be possible or even practical but you may be able to use the macro pump. Adding a bit of code to pause or M1 when a given situation is seen shouldnt be that hard to do. I am fairly new to VB so maybe I am just talking through my arse.
Hood
Title: Re: stop waiting G4
Post by: klmark on March 12, 2007, 05:43:17 PM
I would not mined if i had to push the start buttom on every plunge
Title: Re: stop waiting G4
Post by: Hood on March 12, 2007, 05:47:28 PM
If you will be present each time you plunge could you not then just press the feedhold button then when you want to go again you could press start?

Hood
Title: Re: stop waiting G4
Post by: klmark on March 12, 2007, 06:11:03 PM
That is the problem you always have to be there and just after the plunge it start to cut then you have to reverse the program
Title: Re: stop waiting G4
Post by: Hood on March 12, 2007, 06:20:43 PM
Yes that is true.

Been trying with the macropump and I cant get it to work :( as I said I am new to VB so it may still be possible. In the mean time it wouldnt take long to edit your code, even if you have 50 plunge moves all you would need to do is open your code in notepad, press Ctrl + F, type in the plunge move (eg if the plunge is G0Z1, type that in) then hit find next. You can then enter a new line below such as M1 then press find next and so on, should only take a minute to do.
Sorry cant be much more help :(

Hood
Title: Re: stop waiting G4
Post by: klmark on March 13, 2007, 11:53:19 AM
 Hi
Here is a E-mail which I sent Brian is how I think it can be done


 I notice if I use
 lazycam to create a G code on a part with the plasma options feature
 the M3 commend turn on the plasma  before  the z axis does it's plunge
 which i am sure work if a guy has a automatic torch height control but
 if a guy uses without height control you want the torch to turn on
 when the z axis is plunge the same way it work with a flame cutting
 torch Here is what I thought Art. Could you add something in Lazycam
 in the posting option / plasma options where a guy would add in a
 command line before plunge and after plunge a guy could write in the
 cod like  M1 / Ms that way the machine waits for the start button then
 if you push the start button then the torch would start if you had
 them options for before plunge and after plunge it would work for
 plasma with height or with out height control and with a flame cutting
 torch  my old software worked that way and on that part it worked
 alright then it also could be used for dwell feature So let me know
 what you think it sure would be nice
    as always Thanks again for your understanding that you are working
 with not so smart of a guy
Title: Re: stop waiting G4
Post by: Brian Barker on March 13, 2007, 08:40:05 PM
Hello Mike,
There is a post processor in Lcam and you are just using the default one... I will write you a simple post file to fix your trouble

Thanks
Brian
Title: Re: stop waiting G4
Post by: Brian Barker on March 13, 2007, 08:51:48 PM
Here is a post for you to test. install it into the Mach3 directory and load the post in Lcam under the  "post options"

Also if you would like to edit this more here is the Var list :)
Title: Re: stop waiting G4
Post by: klmark on March 14, 2007, 04:59:37 PM
Hi Brian
 I am Mark not Mike but no big deal I tryed the post 2 problems 1 the G cod program file does not run this file in the status bar it reads Unclosed comment found on line number #1 Problem 2 nothing shows up in the toolpath screen Let me know
   thank you  Mark
Title: Re: stop waiting G4
Post by: Brian Barker on March 14, 2007, 08:25:30 PM
This is a post for Lcam and you need to put it in the mach3 directory. after that you need to select the Post that you would like to use with the Select Post on the Post options dialog. after that you should have the M1's that you wanted in the programs from Lcam
Title: Re: stop waiting G4
Post by: anitel on January 11, 2008, 11:06:08 PM
This post processor is exactly what I was looking for to "manually" control my torch until I get THC.    Thanks a bunch!!!     I've been inserting M1's by hand which gets to be a pain on complicated drawings.
Title: Re: stop waiting G4
Post by: geast on May 22, 2013, 06:57:53 AM
Hello everybody.
I'm facing the same problem with achilleas and the DoOEMButton(288) didnt solve the problem.
Any ideas?