Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: Ben on September 05, 2008, 06:32:20 PM

Title: Probing with G31 problem
Post by: Ben on September 05, 2008, 06:32:20 PM
Riddle me this.  G31Y0.7 will work in MIDI, it will advance to touch and stop, if no touch it will stop when reaching Y=0.7. As it should.

I attach it to a button. Press the button and nothing happens. Choose Operator > Edit button script> select the button, change nothing and save. The file runs as soon as I close the editor (if reset allows). But wont run when the button is pressed. Any ideas? TIA Ben

SetUserLabel 200,"Start probing"
Code "G31 Y0.7"
While IsMoving()      
Wend
SetUserLabel 200,"Finished probing"
Title: Re: Probing with G31 problem
Post by: Ben on September 07, 2008, 06:54:18 PM
No more riddle. I took out the ismoving statements and it works OK.
Title: Re: Probing with G31 problem
Post by: Ben on September 07, 2008, 11:11:27 PM
Riddle back. Take out the ismoving and the code runs to end before the probe stops. Therefor I cant get the touch position. I need the ismoving but it hangs up when ever i put it in no matter where and nothing will move, the program stops at the While ismoving() statement as shown below.
Title: Re: Probing with G31 problem
Post by: Bodini on September 08, 2008, 10:00:14 AM
I use this:

Code: [Select]
While IsMoving()
sleep 100
Wend

I believe that if you are using v2.63 or later, you do not need the Declare sub sleep thing at the start of the macro.  Otherwise, it's:
Code: [Select]
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)

-Nick
Title: Re: Probing with G31 problem
Post by: Ben on September 08, 2008, 01:57:45 PM
Thanks for the help. Im using Ver R3.038. I tried both and the same result. The program hangs up on the ismoving() statement. But Z dosent move

SetUserLabel 200,"Start probing"
Code "G31 Z0.7"
While IsMoving()
sleep 100     
Wend
SetUserLabel 200,"Finished probing"

Im trying to get my probe to find the top surface and then move to Z=0.100.
Title: Re: Probing with G31 problem
Post by: Ben on September 08, 2008, 05:05:49 PM
I went back to Ver2.63 and it all works fine. Something wrong in Ver3.038. Ben
Title: Re: Probing with G31 problem
Post by: Bodini on September 08, 2008, 06:25:23 PM
FIFY (fixed it for you).

"I went back to Ver2.63 and it all works fine. Something wrong in Ver3+. Ben"

 ;) ;D