Hello Guest it is October 18, 2019, 07:46:55 AM

Author Topic: Mach3 stalling during macro  (Read 3062 times)

0 Members and 1 Guest are viewing this topic.

Mach3 stalling during macro
« on: February 22, 2007, 11:35:37 AM »
Hi,
I think i may have found a wee bug in Mach3  :-\. What's happening is that when I run my tool setting macro (hits tool sensor and updates the tool length offset) it randomly pauses all motion (no deceleration, just stops outputting bits to the parallel port) and the DRO stops (so we are not loosing steps). But then it just starts again after about 2 seconds, with no acceleration curve so it physically stalls the z axis motor when it starts up again, and loses steps (a lot of steps).


Its not consistent when it stops, sometimes it does, sometimes it doesn't. Its quite strange.

The mill is a Minitech Mill/3 with Geckos and a Win XP SP2 PIII 3Ghz computer with 512 ram. And im running the latest version (2.something) with a valid licence file (from Minitech)

The macro is below.

Code: [Select]
Sub Main()

HomSigX = IsActive( 2 )
HomSigY = IsActive( 5 )
HomSigZ = IsActive( 8 )
TestSig = True

Select Case TestSig
Case HomSigX
        Print "Home switch active...please deactiivate before tool seek."
Case HomSigY
        Print "Home switch active...please deactiivate before tool seek."
Case HomSigZ
        Print "Home switch active...please deactiivate before tool seek."
Case Else

Xreferd = GetLED( 7 )
Yreferd = GetLED( 8 )
Referd = True

Select Case Referd
   Case Xreferd
         Print "X axis not referenced...please home X axis."
   Case Yreferd
         Print "Y axis not referenced...please home Y axis."
Case Else

 

zStartPos = GetABSPosition(2)

zTSensPos = GetUserDRO( 1212 )
code "G31Z" & zTSensPos & "F500"
While IsMoving()
Wend

SafeGap  = GetABSPosition(2) + 1
code "G53z" & SafeGap & "F100"
While IsMoving()
Wend

zTSensPos = GetUserDRO( 1212 )
code "G31Z" & zTSensPos & "F10"
While IsMoving()
Wend

SensOne = GetABSPosition(2)

SafeGap  = GetABSPosition(2) + 1
code "G53z" & SafeGap & "F500"
While IsMoving()
Wend

zTSensPos = GetUserDRO( 1212 )
code "G31Z" & zTSensPos & "F10"
While IsMoving()
Wend

SensTwo = GetABSPosition(2)

FinalSens = (SensOne + SensTwo)/2

code "G53Z" & FinalSens &"F10"
While IsMoving()
Wend

Call SetOEMDRO(42,FinalSens)


Call DoOEMButton(104)
While IsMoving()
Wend

code "G1 F400"

code "G43"

End Select
End Select
End Sub
 


Any ideas as to whats wrong or a way to prevent it would be greatly appreciated.

Cheers

Reg
Re: Mach3 stalling during macro
« Reply #1 on: February 23, 2007, 10:36:16 AM »
What Rev of mach3 are you running? If you are not on the latest rev you need to update and test it again.

Thanks
Brian
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Mach3 stalling during macro
« Reply #2 on: February 23, 2007, 12:09:38 PM »
Hi.

R2.00.049 is the version that im running. It was doing this on the previous 1.8 release I was using also.

Cheers

Reg
Re: Mach3 stalling during macro
« Reply #3 on: February 24, 2007, 05:49:02 PM »
I have not tested this macro in a program but I can tell you that it is working if I test it in MDI.

Can you get it to run from an MDI line?

Thanks
Brian
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com