Enclosed is a macro to allow the operator to LOAD a part program then the machine will travel the part extents to allow the operator to SEE if the material is large enough to cut the profile. Good for Routing GREAT for plasma users.
Load Program, then move to a position on the material that looks good for the 0,0 origin. Then run the code. IT WILL ASK you if your Z is in postion to TRAVEL safely, if not it will advise you to correct and then it ends. Correct the z height then restart.
The macro will reset the XY axis to zero, then REGEN the toolpath to correct the extents, retreive the extents values, go to the extents of each corner and wait 3 secs then go to the next, it will end back up at the first corner then move back to 0,0.
IF the spindle/Torch centerline stays on the material then you are good to go AND ready to start the cut.
****************************************************************************8
'Macro To AUTOEXTENTS
Sub main()
FR = 30 'Sets FeedRate
DT = 3 'Sets Dwell Time
Msg="Is Your Z HEIGHT Safe To Travel?"
SetVar(120,FR)
SetVar(121,DT)
Response = MsgBox(Msg, 4 )
If Response = 7 Then
GoTo N3:
Else
GoTo N2:
End If
N2:
DoButton(8) 'ZeroX
Sleep(1000)
DoButton(9) 'ZeroY
Sleep(1000)
DoOemButton(160) 'Regen ToolPath
Sleep(1000)
SetVar(100,Getoemdro(4))
Sleep(100)
SetVar(101,Getoemdro(10))
Sleep(100)
Setvar(110,Getoemdro(5))
Sleep(100)
Setvar(111,Getoemdro(11))
Sleep(100)
Code"G1 X#100 Y#110 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#100 Y#111 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#101 Y#111 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#101 Y#110 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#100 Y#110 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X0.000 Y0.000 F#120"
While Ismoving()
Sleep(100)
Wend
DoButton(1)
DoButton(3)
Goto N4:
N3:
MsgBox("Move Z To A Safe Position And Restart")
GoTo N4:
N4:
End Sub
End