PDA

View Full Version : Trying to loop a tool path



alanmcw
06-18-2015, 10:05 AM
I've been running a pretty ordinary file and using the FP command to reload it self and loop till I tell it to quit. I am randomly getting a error at the point/line the file trys to reload the machine stops and throws a missing com error. At this point the shopbot software quits and I need to rezero all three axis. Any body have an idea why this is happening?

I've included the run file so you can see what I am doing.

Any suggestions will be appreciated.

cheers
al

Run File

'----------------------------------------------------------------
'SHOPBOT ROUTER FILE IN INCHES
'GENERATED BY PARTWorks
'Minimum extent in X = 0.000 Minimum extent in Y = 0.000 Minimum extent in Z = 0.000
'Maximum extent in X = 36.000 Maximum extent in Y = 6.000 Maximum extent in Z = 1.500
'Length of material in X = 36.000
'Length of material in Y = 6.000
'Depth of material in Z = 1.500
'Home Position Information = Bottom Left Corner, Table Surface (move to 2.5" offset from default 0,0)
'Home X = 0.000000 Home Y = 0.000000 Home Z = 2.5
'Rapid clearance gap or Safe Z = 2.000
'UNITS:Inches
'
IF %(25)=1 THEN GOTO UNIT_ERROR 'check to see software is set to standard
SA 'Set program to absolute coordinate mode
CN, 90
'New Path
'Toolpath Name = Drill for inserts (5-32 mill)
'Tool Name = 5/32" Up-cut (13729)
&PWSafeZ = 2.000
&PWZorigin = Table Surface
&PWMaterial = 1.500
'&ToolName = "5/23" Up-cut (13729)"
&Tool =5 'Tool number to change to
SO,1,1 'Turning router ON
'Go? (&ToolName)
Pause
'
MS,1.5,1.0
JZ,2.5
J3,3.249947,0.812577,2.000000
J3,3.249947,0.812577,1.700000
M3,3.249947,0.812577,1.500000
M3,3.250073,0.815385,1.498210
M3,3.250468,0.818263,1.496359
M3,3.251153,0.821175,1.494454
----Snip----
J3,0.046900,1.415996,2.500000
C7 'Turning router OFF
JZ,2.50000
J3,0.000000,-2.000000,2.500000 'Move router out of way
'
'Reload Jig, Click OK to continue.
Pause
J2,0.00,0.00
FP, Machine for inserts and Trim.sbp ,,,,,2 'reloads file till user quits at previous prompt
'
C7 'Turning router OFF
END
'
UNIT_ERROR:
CN, 91 'Run file explaining unit error
END

barrowj
06-18-2015, 12:12 PM
Al,

I would just have the file loop instead of reloading it, you would need the following:

'----------------------------------------------------------------
'SHOPBOT ROUTER FILE IN INCHES
'GENERATED BY PARTWorks
'Minimum extent in X = 0.000 Minimum extent in Y = 0.000 Minimum extent in Z = 0.000
'Maximum extent in X = 36.000 Maximum extent in Y = 6.000 Maximum extent in Z = 1.500
'Length of material in X = 36.000
'Length of material in Y = 6.000
'Depth of material in Z = 1.500
'Home Position Information = Bottom Left Corner, Table Surface (move to 2.5" offset from default 0,0)
'Home X = 0.000000 Home Y = 0.000000 Home Z = 2.5
'Rapid clearance gap or Safe Z = 2.000
'UNITS:Inches
'
IF %(25)=1 THEN GOTO UNIT_ERROR 'check to see software is set to standard
SA 'Set program to absolute coordinate mode
CN, 90
'New Path
'Toolpath Name = Drill for inserts (5-32 mill)
'Tool Name = 5/32" Up-cut (13729)
&PWSafeZ = 2.000
&PWZorigin = Table Surface
&PWMaterial = 1.500
'&ToolName = "5/23" Up-cut (13729)"
&Tool =5 'Tool number to change to
SO,1,1 'Turning router ON
'Go? (&ToolName)
Pause
'
BEGIN:
MS,1.5,1.0
JZ,2.5
J3,3.249947,0.812577,2.000000
J3,3.249947,0.812577,1.700000
M3,3.249947,0.812577,1.500000
M3,3.250073,0.815385,1.498210
M3,3.250468,0.818263,1.496359
M3,3.251153,0.821175,1.494454
----Snip----
J3,0.046900,1.415996,2.500000
Pause
'Hit escape if you wish to quit
J2,0.00,0.00
GOTO Begin


C7 'Turning router OFF
JZ,2.50000
J3,0.000000,-2.000000,2.500000 'Move router out of way


END
'
UNIT_ERROR:
CN, 91 'Run file explaining unit error
END



Joe

srwtlc
06-18-2015, 12:34 PM
Al,

That won't loop the file, but just run it one more time. The error issue may be a file location issue or possible nesting the same file within the file.

To add to Joe's suggestion, if you are using v3.8.XX, you can use the PAUSE UNTIL method and set up a repeat button that is tied into an input. For example, I have a button that is hooked to input 1 (can use any available input) and when I'm ready to restart/loop the file, I just push a button at the gantry to repeat. Saves time by not having to go to the keyboard/mouse to answer the pause message.

Snip from the programing handbook...

PAUSE UNTIL works just like PAUSE (without a time) except that an Input Switch can be used as the equivalent of the OK input button. For example, programming PAUSE UNTIL 5, 1 will PAUSE until the OK button is entered or the #5 Input Switch is closed. Any message in a preceding comment line will be displayed as with the simple PAUSE instruction. Use a 0 to detect an Input Switch opening, or 1 to detect a Switch closing.
By default, when motion is initiated after an Input Switch PAUSE, there will be a warning and short wait, just like at the beginning of a file to provide a safety interval. This can be eliminated by turning the wait off with [SW] before the call to function, then restoring it. There is a sample file in the SbParts folder (sample_for_switch.sbp) that illustrates.

If you're using an older version, there's an alternate method of this that works well too.