Hello Guest it is December 15, 2019, 07:23:55 PM

Author Topic: Probing with G31 problem  (Read 3508 times)

0 Members and 1 Guest are viewing this topic.

Offline Ben

*
  •  79 79
    • View Profile
Probing with G31 problem
« 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"

Offline Ben

*
  •  79 79
    • View Profile
Re: Probing with G31 problem
« Reply #1 on: September 07, 2008, 06:54:18 PM »
No more riddle. I took out the ismoving statements and it works OK.

Offline Ben

*
  •  79 79
    • View Profile
Re: Probing with G31 problem
« Reply #2 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.

Offline Bodini

*
  •  216 216
    • View Profile
Re: Probing with G31 problem
« Reply #3 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

Offline Ben

*
  •  79 79
    • View Profile
Re: Probing with G31 problem
« Reply #4 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.

Offline Ben

*
  •  79 79
    • View Profile
Re: Probing with G31 problem
« Reply #5 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

Offline Bodini

*
  •  216 216
    • View Profile
Re: Probing with G31 problem
« Reply #6 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