Hey,
I'm getting artcode error 8877 and 9991
What to do, what to do?
I'm running XP pro, latest .036 mach, latest smooth stepper. When I try to run
the following Macro is when I get error. It worked fine previously and currently
on another machine. I also get the same error with .032
Here is the M command it locks on:
REM M1051 For GRIND To DIMENSION
Option Explicit
Dim FinishDim As Double
Dim ToGrind As Double
Dim HoldToGrind As Double
Dim Current As Double
Dim Remainder As Double
Dim SparkoutCounter As Integer
Dim RoughToGo As Double
Dim FinishToGo As Double
Dim RoughInc
Dim FinishInc
Dim Sparkouts As Integer
Dim LeftX
Dim RightX
Dim LeftFeedX
Dim RightFeedX
Dim LeftDwell
Dim RightDwell
LeftDwell = GetOEMDRO(1110)
RightDwell = GetOEMDRO(1120)
FinishDim = GetOEMDRO(1056)
ToGrind = 0
Current = 0
Remainder = 0
SparkoutCounter = 0
RoughToGo = 0
FinishToGo = 0
RoughInc = GetOEMDRO(1052)
FinishInc = GetOEMDRO(1053)
Sparkouts = GetOEMDRO(1054)
LeftX = GetOEMDRO(1060)
RightX = GetOEMDRO(1061)
LeftFeedX = GetOEMDRO(1162)
RightFeedX = GetOEMDRO(1163)
Current = GetOEMDRO(801)
ToGrind = Current - FinishDim
HoldToGrind = ToGrind * 1000000
ToGrind = HoldToGrind * .000001
Current = 0
While ((ToGrind + .00001) >= .001)
ToGrind = ToGrind - .001
RoughToGo = RoughToGo + 1
Wend
While ((ToGrind + .00001) >= .0001)
ToGrind = ToGrind - .0001
FinishToGo = FinishToGo + 1
Wend
If (RoughToGo >0) Then
Code "M8 M3"
Code "G04 P2."
While ((Current + (RoughInc / 10)) <= RoughToGo)
rem turn On side travel
If GetUserLed (1100) Then
Code "G90G01 X" & LeftX & "F" & RightFeedX
Code "G91G00 Y-" & (RoughInc / 10000)
Code "G04 P" & LeftDwell
Code "G90G01 X" & RightX & "F" & LeftFeedX
Code "G04 P" & RightDwell
Current = Current + (RoughInc / 10)
Remainder = RoughToGo - Current
End If
If ((Current + (RoughInc / 10)) <= RoughToGo) Then
If GetUserLed (1101) Then
Code "G90G01 X" & RightX & "F" & LeftFeedX
Code "G91G00 Y-" & (RoughInc / 10000)
Code "G04 P" & RightDwell
Code "G90G01 X" & LeftX & "F" & RightFeedX
Code "G04 P" & LeftDwell
Current = Current + (RoughInc / 10)
Remainder = RoughToGo - Current
End If
End If
Wend
End If
If (Remainder > 0) Then
Remainder = Remainder * 10
FinishToGo = FinishToGo + Remainder
End If
Current = 0
Remainder = FinishToGo
If (FinishToGo > 0) Then
Code "M8 M3"
Code "G04 P2."
While (Current < (FinishToGo - FinishInc))
rem turn On side travel
If GetUserLed (1100) Then
Code "G90G01 X" & LeftX & "F" & RightFeedX
Code "G91G00 Y-" & (FinishInc / 10000)
Code "G04 P" & LeftDwell
Code "G90G01 X" & RightX & "F" & LeftFeedX
Code "G04 P" & RightDwell
Current = Current + FinishInc
Remainder = FinishToGo - Current
End If
If (Current < (FinishToGo - FinishInc)) Then
If GetUserLed (1101) Then
Code "G90G01 X" & RightX & "F" & LeftFeedX
Code "G91G00 Y-" & (FinishInc / 10000)
Code "G04 P" & RightDwell
Code "G90G01 X" & LeftX & "F" & RightFeedX
Code "G04 P" & LeftDwell
Current = Current + FinishInc
Remainder = FinishToGo - Current
End If
End If
Wend
End If
If (Remainder > 0) Then
Code "M8 M3"
Code "G04 P2."
rem turn On side travel
If GetUserLed (1100) Then
Code "G90G01 X" & LeftX & "F" & RightFeedX
Code "G91G00 Y-" & (Remainder / 10000)
Code "G04 P" & LeftDwell
Code "G90G01 X" & RightX & "F" & LeftFeedX
Code "G04 P" & RightDwell
Remainder = 0
End If
If (Remainder > 0) Then
If GetUserLed (1101) Then
Code "G90G01 X" & RightX & "F" & LeftFeedX
Code "G91G00 Y-" & (Remainder / 10000)
Code "G04 P" & RightDwell
Code "G90G01 X" & LeftX & "F" & RightFeedX
Code "G04 P" & LeftDwell
Remainder = 0
End If
End If
End If
rem last final Left over
Current = GetOEMDRO(801)
FinishDim = GetOEMDRO(1056)
Remainder = Current - FinishDim
HoldToGrind = Remainder * 1000000
Remainder = HoldToGrind * .000001
If (FinishDim <> Current) Then
Code "M8 M3"
Code "G04 P2."
rem turn On side travel
If GetUserLed (1100) Then
Code "G90G01 X" & RightX & "F" & LeftFeedX
Code "G04 P" & RightDwell
Code "G90G00 Y" & FinishDim
Remainder = 0
End If
If (Current < (FinishToGo - FinishInc)) Then
If GetUserLed (1101) Then
Code "G90G01 X" & LeftX & "F" & RightFeedX
Code "G04 P" & LeftDwell
Code "G90G00 Y" & FinishDim
Remainder = 0
End If
End If
End If
If ((RoughToGo + FinishToGo) > 0) Then
Code "M8 M3"
Code "G04 P2."
If GetOEMLED(1102) Then
While (Sparkouts > SparkoutCounter)
Code "G90G01 X" & RightX & "F" & LeftFeedX
Code "G04 P" & RightDwell
SetUserLED(1110,0)
SetUserLED(1111,1)
Code "G90G01 X" & LeftX & "F" & RightFeedX
Code "G04 P" & LeftDwell
SetUserLED(1111,0)
SetUserLED(1110,1)
SparkoutCounter = SparkoutCounter + 1
Wend
End If
If GetOEMLED(1103) Then
While (Sparkouts > SparkoutCounter)
Code "G90G01 X" & LeftX & "F" & RightFeedX
Code "G04 P" & LeftDwell
SetUserLED(1111,0)
SetUserLED(1110,1)
Code "G90G01 X" & RightX & "F" & LeftFeedX
Code "G04 P" & RightDwell
SetUserLED(1110,0)
SetUserLED(1111,1)
SparkoutCounter = SparkoutCounter + 1
Wend
End If
End If
Code "M9 M5"
Any Ideas?
T. Byrd