Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started 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"
-
No more riddle. I took out the ismoving statements and it works OK.
-
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.
-
I use this:
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:
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
-Nick
-
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.
-
I went back to Ver2.63 and it all works fine. Something wrong in Ver3.038. Ben
-
FIFY (fixed it for you).
"I went back to Ver2.63 and it all works fine. Something wrong in Ver3+. Ben"
;) ;D