51
VB and the development of wizards / Re: How to get the current subroutine file name?
« on: July 21, 2010, 03:15:09 AM »
Thank you Dave, Terry, Ya-Nvr-No and everyone
This seems to work... the reason I took out wait for the regen LED to come on is in some cases the file is aready loaded and that would cause the script to get stuck.
Ya-Nvr-No code looks good cept for if the user Feedholds the current loaded file or other cases that the machine is not moving could cause some issues.
This seems to work... the reason I took out wait for the regen LED to come on is in some cases the file is aready loaded and that would cause the script to get stuck.
Ya-Nvr-No code looks good cept for if the user Feedholds the current loaded file or other cases that the machine is not moving could cause some issues.
Code: [Select]
LoadFile"c:\mach3\gcode\roadrunner.tap"
DoOEMButton(MachSimRoutine)
Call WaitForSimFinish()
Const RegenInProcessLED = 179 ' On during regen & Sim process
Sub WaitForSimFinish()
sleep(10) ' we want at tighter loop here
'sleep 10
'message "waiting for end transition"
'sleep 10
' ok the process started, wait for it to end
While CBool(GetOEMLED(RegenInProcessLED))
' wait for process to finish
'message "waiting for sim to end"
sleep(100)
Wend
Sleep (100) ' add a bit of pad time
'message "sim ended"
' ok, best we can tell, the process started and then ended, let's return to the caller
runfile()
Exit Sub
End Sub