Hello Guest it is March 28, 2024, 12:33:39 PM

Author Topic: VB / macro execution problem, 2D-contour probing  (Read 3527 times)

0 Members and 1 Guest are viewing this topic.

VB / macro execution problem, 2D-contour probing
« on: February 13, 2010, 02:49:24 PM »
Hi all,
I'm going to create some macro code to do 2D digitizing/probing. I did 8 macros to do e.g. probing in +Y direction until trip, then retracting the probe by running a quarter circle in  of the probe in -Y+X direction and do this in a loop until a defined X distance has been probed or until the probe does not trip.
Attached my macro M817.

Problem is:
It seems, that when inside of the while-loop the oemDROs will not updated and also the check for "OverTravel" (probe does not trip in the G31-distance) will not do properly.

When the probe does not trip in the first sequence the result is as expected: linear retract by ProbeTravel.
But after one or more trips of the probe and then coming behind the edge the probe runs for the complete G31-distance, then does the circular retract, probes again ...

I'm not too familiar with VB programming, so maybe you could see the bug?

Thanks for helping!
Regards
Holger
Re: VB / macro execution problem, 2D-contour probing
« Reply #1 on: February 15, 2010, 03:27:04 PM »
 ???
Sorry folks, did I ask somethin upsetting? Or did I miss any stupid thing I should have known?
I only want to know why I can't get my variables and DROs updated while in a "while-loop? Or at least a work-around...

Your help's apreciated. :-*
Thank you.
Holger
Re: VB / macro execution problem, 2D-contour probing
« Reply #2 on: February 15, 2010, 04:42:01 PM »
Sorry for bothering you all with my stupid question. >:D
Solved the problem.

For all who are interested - facing the danger to repeat trivial things the thousand's time- a   ::)
"While IsMoving()                                         
   Sleep (1000)
  Wend"
just at begin of my while-loop did it. It allowed Mach to finish the retract moves before reading again the DRO.

Thanks to all who contributed... ;D
Re: VB / macro execution problem, 2D-contour probing
« Reply #3 on: February 15, 2010, 04:58:47 PM »
There was something upsetting about it ! ::)
It upset me that I don't know enough about it to help you out.....damn, that makes me MAD. >:(

Happy you got it.......and shared the result.
That's the best part.
Thanks,
Russ :)
Re: VB / macro execution problem, 2D-contour probing
« Reply #4 on: February 16, 2010, 04:08:22 PM »
Sometimes it seem to help just to write down the thoughts... Attached my results, in case anybody want to mod them. :)

The M812 is my prototype of eight macros. By setting the Probing Axis (PAx)axis, the Stepover Axis (SAx) and the directions (DP-direction of probing, DS-direction of stepover) the code will then sample the data from some user-DROs and then probing an edge until the end is reached or the required distance is finished. (Ooops, one "bug" still in there: when determining the number of repetitions it uses always the Y-lenth DRO 1007. Have to select between 1006 and 1007 here depending from the axis to be probed...)
I made a screem with eight buttons and the DROs to group all probing related controls.

The M822 code is for determination of the probe tip diameter. I made a aluminum rectangle plate (88x70mm, out of the bin), milled a 50mm dia hole into it and placed it on the surface. From any starting point of the probe tip inside the hole it probes the hole to get the center, then probes the diameter in X and Y, calculates the probe tip dia and finally probes the outer dimensions to double check the settings.

Cheers
Holger