Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: Deon Gerber on May 01, 2006, 05:18:59 AM
-
Hi Brian
I need some help with a couple of VB problems. I am working on a Job-Setup Wizard where you can just drop your work piece on the table without setting up ,clamp and then touch off with a probe on two spots. The Wizard will then calculate the off-set angle and write it into the currently loaded G-code File as a G68 move. In short that is what is supposed to happen. I did encounter a couple of problems though.
1. How do I load the currently loaded G code into the Wizard. Do I have to load it in by the actual file name or is there a common load procedure like.........call LoadTeachFile()
2. How do I go about appending the G-code file at the right places. When I use ......AppendTheachFile......the G68 gets Written at the end of the G-code, Art said it would be best to add the G68 after the tool change and then again cancel before the next tool change. I think this is the biggest problem to overcome.
Thanks in advance for the help.
Deon
-
O Boy :) That is not a simple starter program :( I had a wizard that did that at one time... I had it about 75% done and it did work too. I just set the G68 R and Never did a G69 to turn it off. I think that will work. Type G68 R45 in MDI and run a program to test it.
-
Hi Brian
I did a couple of tests by just adding the G68 at the beginning, it seems to work but I just thought it would be saver to go with Arts recommendations.
Have you perhaps have a copy of the unfinished Wizard. I would like to study it and apply your knowledge to mine as well. I will give you credit off course.You can mail it to custom@polka.co.za .If you don't have a copy the question's still remain even just to get it to add the G68 at the beginning of the file.
And off course, if I need to call the file by name a Dialog box with some sort of a browse capability to load the file into the Wizard.
I am a very persistant guy, when I set my mind to something I wont stop before I cracked it.
Thanks
Deon
-
I think the first thing is to get the wizard working right... I think there is a copy of the wizard int he files section of the yahoo group. If you can't find it tell me and I will give you a hand
Thanks
Brian
-
Hi Brian
Ok I will let you know when the body work is done.
I had a look at yours in the file section , it might just help. My thought was to use G32 commands to touch off with the touch probe. I will see what I can come up with.
Thanks for your help anyway.
Deon
-
Hi Brian
I see I had a typo in the previous post. It should be G31 not G32. That set aside, here are extract from a vb button..........
Length=GetUserDro(1020)
Clearance=GetUserDro(1010)
'The following is for offline testing!
Call SetVar(2001,99999)
Call SetUserDRO(1030,GetVar(2001))
Call SetUserDRO(1040,GetVar(2001))
Code "G91" 'Switch to incremental mode
Code "G31 Y-" & Clearance 'First Probing move
'Again only for offline testing!
Call SetUserDro(1030,GetVar(2001)) '************************************
Code "G0 Y" & Clearance 'Rapid Clearance move
Code "G0 X" & Length 'Rapid move to second Touch point
Code "G31 Y-" & Clearance 'Second Probing move
'Again only for offline Testing
Call SetUserDRO(1040,GetVar(2001)) '************************************
Code "G0 Y" & Clearance 'Rapid Clearance move
The problem I encounter.....While stepping into the script line for line everything works as planed. But when I run the button
The two lines where I call for ........... SetUserDRO(1030,GetVar(2001)) and SetUserDRO(1040,GetVar(2001)).......somehow gets skiped and the DRO's dont get updated. I think I need something to pause the process to give time for the update.
Please Help!
-
Hi its me again
Problem solved. I aded some ........
While IsMoving()
WEnd
Its running nicely now. Brian I am almost there please keep your self ready with that Append and load script... ;D
Thanks
Deon
-
Great job!!!