Hello Guest it is March 29, 2024, 08:29:13 AM

Author Topic: LoadRun hangs loading G-code?  (Read 3908 times)

0 Members and 1 Guest are viewing this topic.

LoadRun hangs loading G-code?
« on: December 05, 2013, 01:20:52 AM »
(Inside of a macro)...
Code: [Select]
value1 = GetuserDRO(1005) 'Tube Dia scale
value2 = GetuserDRO(1000) 'Tube length
value3 = GetuserDRO(1001) 'Tube length
value4 = GetuserDRO(1003) 'Start Cope angle file
value5 = GetuserDRO(1004) 'End Cope file

Code "G51 Y"&value1

If value4 = 90 Then
LoadRun ("D:\Mach3\Gcode\90.NCF")
ElseIF value4 = 60 Then
Print 60
ElseIF value4 = 45 Then
Print 45
ElseIF value4 = 30 Then
Print 30
ElseIf value4 = 20 Then
Print 20
ElseIf value4 = 15 Then
Print 15
End If
Not sure WHY? I can run the program no problem. I've tried loading the file, that works. But DoOEMButton(0) didn't work.
RunFile didn't work.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: LoadRun hangs loading G-code?
« Reply #1 on: December 05, 2013, 11:31:45 AM »
Use the button DoButton(0) or  DoOemButton(800)

I believe that loadrun is busted. USE LoadFile()   THEN   RunFile() to make it work.

(;-) TP
« Last Edit: December 05, 2013, 11:36:39 AM by BR549 »
Re: LoadRun hangs loading G-code?
« Reply #2 on: December 07, 2013, 12:20:02 AM »
Is this code too big for an macro? It hangs on the first file load running as an macro.
Code: [Select]
'M2000
value1 = GetuserDRO(1005) 'Tube Dia scale
value2 = GetuserDRO(1000) 'Tube length
value3 = GetuserDRO(1001) 'Rotation
value4 = GetuserDRO(1003) 'Start Cope angle file
value5 = GetuserDRO(1004) 'End Cope file
indeg = (value3*0.00872222)

Code "G92 X0 Y0 Z0"
Sleep (1000)
Code "G50"
Sleep (500)
Code "G51 Y"&value1

If value4 = 90 Then
LoadFile ("Gcode\90.NCF")
ElseIF value4 = 60 Then
LoadFile ("Gcode\60.NCF")
ElseIF value4 = 45 Then
LoadFile ("Gcode\45.NCF")
ElseIF value4 = 30 Then
LoadFile ("Gcode\30.NCF")
ElseIf value4 = 20 Then
LoadFile ("Gcode\20.NCF")
ElseIf value4 = 15 Then
LoadFile ("Gcode\15.NCF")
End If
While IsLoading ()
Sleep (2000)
Wend
Sleep(500)
RunFile ()
Sleep (5000)
While IsMoving()
Sleep (2000)
Wend
If value5 = 90 Then
LoadFile ("Gcode\90.NCF")
ElseIF value5 = 60 Then
LoadFile ("Gcode\60.NCF")
ElseIF value5 = 45 Then
LoadFile ("Gcode\45.NCF")
ElseIF value5 = 30 Then
LoadFile ("Gcode\30.NCF")
ElseIf value5 = 20 Then
LoadFile ("Gcode\20.NCF")
ElseIf value5 = 15 Then
LoadFile ("Gcode\15.NCF")
End If
While IsLoading ()
Sleep (2000)
Wend
Sleep(500)
Code "G0 X"&value2
While IsMoving()
Sleep(500)
Wend
Code "G50"
Sleep (500)
Code "G51 X-1.0"
Sleep (500)
Code "G0 Y"&indeg
Sleep (500)
While IsMoving()
Sleep(500)
Wend
Code "G51 Y"&value1
Sleep (500)
RunFile ()
But it runs just fine under the VB script editor  ???
Need to run it when the user pushes a button.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: LoadRun hangs loading G-code?
« Reply #3 on: December 07, 2013, 12:31:36 AM »
Well you have about 27 sec of sleep time ????

Are you sure that is not your problem ???

Just a thought, (;-) TP
Re: LoadRun hangs loading G-code?
« Reply #4 on: December 07, 2013, 11:01:14 AM »
No, runs great in VB script editor.
Re-saved it in the base mach dir and made a script button has -
RunScript ("filename")
Works awesome.
Re: LoadRun hangs loading G-code?
« Reply #5 on: December 07, 2013, 12:33:46 PM »
 :)
« Last Edit: December 07, 2013, 12:38:10 PM by Ya-Nvr-No »