Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 26, 2012, 12:37:06 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
How to get the current subroutine file name?
Pages:
«
1
2
3
Go Down
« previous
next »
Author
Topic: How to get the current subroutine file name? (Read 1302 times)
0 Members and 2 Guests are viewing this topic.
zealous
Active Member
Offline
Posts: 486
Re: How to get the current subroutine file name?
«
Reply #20 on:
July 19, 2010, 06:27:00 PM »
I don't mean to hijack this topic but "LoadRun" has been freezing up Mach for me...is this happening to anyone else?
Logged
Regards, Jason Blake
www.Fusioncnc.com
BR549
Active Member
Offline
Posts: 2,553
Re: How to get the current subroutine file name?
«
Reply #21 on:
July 19, 2010, 07:22:57 PM »
Sometimes it runs sometimes it does not run. IF it freezes it is during the REGEN on load.
Logged
BR549
Active Member
Offline
Posts: 2,553
Re: How to get the current subroutine file name?
«
Reply #22 on:
July 19, 2010, 07:34:29 PM »
Jason, I looked back through some old trouble notes, try this
Loadrun"C:\mach3\Gcode\Filename.tap"
While Isloading()
Sleep(1000)
Wend
IT seems that mach tries to hop out of VB before the fileload is complete.
Just a thought
Logged
DaveCVI
V4 Screen Contributor
Offline
Posts: 532
Re: How to get the current subroutine file name?
«
Reply #23 on:
July 19, 2010, 07:45:41 PM »
Terry, Jason,
This is related to the LoadRun topic - below is a little routine I've been using to sync up with the regen operation.
You may find this useful.
DoOEMButton(MachSimRoutine)
call WaitForSimFinish()
Const RegenInProcessLED = 179 ' On during regen & Sim process
Sub WaitForSimFinish()
' the call to start the mach SimRoutine is not synchrounous - in V3 it starts off a separate process that does the mach sim
' this routine attempts to wait until the sim routine is finished.
'
' ok this is an imperfect routine in that there is a potential timing hole.
' not much we can do since mach does not provide semaphores or locks for async operations.
' the "RegenLED" is supposed to be on while the regen (and Sim) operation is in process and then
' it goes off when the process finishes.
' we wait for the LED to come on - that should mean that either
' a) the sim process is in progress, or
' b) the sim process finished before we had a chance to see it was in progress
' then we wait for the LED to go off - that should mean the process is completed.
'message "starting sim wait"
While not CBool(GetOEMLED(RegenInProcessLED))
' process is not running, wait for it to start
sleep(10) ' we want at tighter loop here
'message "waiting for led to go ON"
Wend
'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
Exit Sub
End sub
Logged
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Ya-Nvr-No
Active Member
Offline
Posts: 268
Scuptris 3D
Re: How to get the current subroutine file name?
«
Reply #24 on:
July 19, 2010, 08:17:05 PM »
This was my first attempt but it did work in a dry run.( Note: haven't tried to cut anything yet)
Dim fname1,fname2,fname3,fname4,fname5 As String
fname1 ="c:\mach3\gcode\roadrunner.tap"
fname2 ="c:\mach3\gcode\airfoil.tap"
fname3 ="c:\mach3\gcode\test55.tap"
fname4 ="c:\mach3\gcode\tt.txt"
fname5 ="c:\mach3\gcode\signA1.tap"
For x = 1 To 5
If x = 1 Then loadfile(fname1)
If x = 2 Then loadfile(fname2)
If x = 3 Then loadfile(fname3)
If x = 4 Then loadfile(fname3)
If x = 5 Then loadfile(fname3)
message(filename)
While Isloading()
Sleep(5000)
Wend
runfile()
Sleep(2000)
While IsMoving()
Sleep(2000)
Wend
Next x
message("thats all folks")
Logged
BR549
Active Member
Offline
Posts: 2,553
Re: How to get the current subroutine file name?
«
Reply #25 on:
July 19, 2010, 08:18:23 PM »
Thanks Dave I will give it a spin,(;-)
Logged
BR549
Active Member
Offline
Posts: 2,553
Re: How to get the current subroutine file name?
«
Reply #26 on:
July 19, 2010, 08:49:03 PM »
That is a really good idea YA-NVR. It just needs alittle more work.
Perhaps use teh question as a front end to load the filenames on the fly
Fname1= Question"File1 name?"
etc
etc
Next how are you going to deal with the fixture offsets between files?
Maybe another question session?
File1OFFSET = Question"FIle1 Fixture#?"
NOTE: You also need to plan on a way to break OUT of the routine in the event you need to STOP IT. I just tried and it was NOT pretty Crashed mach to get out.
Make a screen button to start the process. VERY GOOD idea. (;-)
I think there is a spot available over in the MACH Tool Box for a good AUTO BATCH LOADER (;-)
Might want to start a new thread to continue
«
Last Edit: July 19, 2010, 09:00:16 PM by BR549
»
Logged
zealous
Active Member
Offline
Posts: 486
Re: How to get the current subroutine file name?
«
Reply #27 on:
July 21, 2010, 02: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.
Code:
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
Logged
Regards, Jason Blake
www.Fusioncnc.com
BR549
Active Member
Offline
Posts: 2,553
Re: How to get the current subroutine file name?
«
Reply #28 on:
July 21, 2010, 05:43:38 PM »
HIya Jason glad you got it working, I think the auto loader was meant for unatended use where you load up a batch of programs and walk away. Any interaction beyound that is TRICKY. Even just stopping the routine can be tricky(;-) Working on that part. I ran another long test today and it is due to finish about 8am tommorrow. So far so good.
The next test will be to see IF it can handle programs with SUBs. Then test for Users macros That ought to be interesting
(;-)
Logged
Pages:
«
1
2
3
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...