cncdrive wrote:Hi Eric,
Thank you for the testing and confirming that the probing works OK now.
About the delays: I have checked and ran your macro a few times but I do not see the mentioned delays, I mean on my computers it all run as it should without the delays you mentioned.
Can you please check and tell me a few things:
1.) Are the delays there on both of your computers?
2.) Can you test if the delay is caused by the exec.Code or the while(exec.IsMoving()){} or the exec.Wait(); ?
I mean I'm not sure which one is causing the delay for you.
I'm thinking of making a very simple macro with just executing one exec.Code and before that a MessageBox.Show and also after that a MessageBox to see if there is any delays before or after that.
Another test I advice is to place a IDLE LED (copy from the Diagnostics page) and check when does the controller goes back to idle after the movement stops and then place the while(exec.IsMoving()){} to see if the issue is that the controlles changes late to idle.
And the third is to place an exec.Wait with for example 1000msec time between MessageBoxes and check if the wait time is the delay cause or not.
Unfortunately all of these works fine on my computer, so I need some help in narrowing down the problem so we could see what is causing the delay on your system,
if we could see at least which function is causing it then we will have a higher chance to find the reason.
Hi Balazs,
I finally got a little test time.
1) The delay is NOT on both computers, it is only on the 'shop' computer that originally would not trigger probe input. office computer works fine.
2) I did a bunch of tests using my G31 touchplate macro, and have it pinpointed to the exec.wait(xxxx) as the culprit. I verified that there is no delay for the control going to idle from run. I put a message box on either side of an exec.wait, and could then count out actual seconds as compared to milisec. I will attach my sample code below, which has comments with actual delays in seconds listed as notes.
The final thing I did was to comment out every single exec.wait from the macro, and it ran great, just like it always used to.
Hope this helps!
regards,
Eric
- Code: Select all
//M31 probing macro
//double probeX = 200;
//double probeY = 300;
double Zmin = -5;
double Feedrate = 10;
double Feedrateslow = 1;
double Slowretract=.05;
double SafeZ = 2;
double retractheight = 1.0;
double platethick = 1.0;
//if(!exec.GetLED(56)||!exec.GetLED(57)||!exec.GetLED(58)) // If machine was not homed then it is unsafe to move in machine coordinates, stop here...
//{
// MessageBox.Show("The machine was not yet homed, home the machine before run to parking position!");
// exec.Stop();
// return;
//}
//MessageBox.Show("start"); instantly appears-not problem
while(exec.IsMoving()){}
//MessageBox.Show("after ismoving"); no delay here-not problem
exec.Wait(200);
//MessageBox.Show("after wait 200"); a delay here, ~1-2 seconds
double Xoriginalpos = exec.GetXmachpos(); // Get the current machine coordinates
double Yoriginalpos = exec.GetYmachpos(); // Get the current machine coordinates
//exec.Code("G00 G53 Z" + SafeZ); // Move Z up first
//while(exec.IsMoving()){}
//exec.Code("G00 G53 X" + probeX +" Y" + probeY); // Move to the probe sensor position in XY
//while(exec.IsMoving()){}
//MessageBox.Show("probe"); no delay here - not problem
exec.Code("G31 Z" + Zmin + "F" + Feedrate); // Move to the probe sensor position in XY
while(exec.IsMoving()){}
//MessageBox.Show("pre-wait"); no delay here-not problem
exec.Wait(200);
//MessageBox.Show("post-wait"); delay here ~2-4 seconds!!
double Zupslow = exec.GetZmachpos() + Slowretract;
if(Zupslow > SafeZ)
{
Zupslow = SafeZ;
}
exec.Code("G00 G53 Z" + Zupslow); // Move to slow clearance plane
while(exec.IsMoving()){}
//MessageBox.Show("pre-wait"); //no delay here-not problem
exec.Wait(1000);
//MessageBox.Show("post-wait"); // delay here ~15 seconds!!
exec.Code("G31 Z" + Zmin + "F" + Feedrateslow); // Move to the probe sensor position in XY
while(exec.IsMoving()){}
exec.Wait(200);
AS3.Setfield(platethick, 99); //Sets the value of the z current coordinate field to 'platethick'
AS3.Validatefield(99); //Validates the 'platethick' valuefor the z current coordinate field with writting the offset coordinates as nessessary.
//if(!exec.Ismacrostopped()) // If tool change was not interrupted with a stop only then validate new tool number
//{
// exec.Code("G44 H1"); // Load tool offset one, note the tool lenght is defined in the tools menu
// while(exec.IsMoving()){}
// exec.Wait(1000);
double Zup = exec.GetZmachpos() + retractheight;
if(Zup > SafeZ)
{
Zup = SafeZ;
}
exec.Code("G00 G53 Z" + Zup); // Move 1inch above probe plate
while(exec.IsMoving()){}
exec.Wait(1000);
// exec.Code("G00 G53 X" + Xoriginalpos +" Y" + Yoriginalpos); // Move back to the original XY position
// while(exec.IsMoving()){}
//}