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, 01:28:59 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
Auto Batch Loader(;-)
Pages:
1
Go Down
« previous
next »
Author
Topic: Auto Batch Loader(;-) (Read 565 times)
0 Members and 2 Guests are viewing this topic.
BR549
Active Member
Offline
Posts: 2,553
Auto Batch Loader(;-)
«
on:
July 19, 2010, 11:25:00 PM »
Here is some code to play with for an Auto Batch Loader This idea came from another thread(ya-nvr-no) I just brought it here to expand on the idea (;-)
'Auto Batch Loader
Dim fname1,fname2,fname3,fname4,fname5 As String
Dim F1offset,F2offset,F3offset,F4offset,F5offset As Double
fname1 ="c:\mach3\gcode\" & AskTextQuestion("File#1 Name?")
F1offset= "" & Question("File#1 Offset#")
Message(Fname1 & " AND G" & F1offset)
fname2 ="c:\mach3\gcode\" & AskTextQuestion("File#2 Name?")
F2offset= "" & Question("File#2 Offset#")
Message(Fname2 & " AND G" & F2offset)
fname3 ="c:\mach3\gcode\" & AskTextQuestion("File#3 Name?")
F3offset= "" & Question("File#3 Offset#")
Message(Fname3 & " AND G" & F3offset)
fname4 ="c:\mach3\gcode\" & AskTextQuestion("File#4 Name?")
F4offset= "" & Question("File#4 Offset#")
Message(Fname4 & " AND G" & F4offset)
fname5 ="c:\mach3\gcode\" & AskTextQuestion("File#5 Name?")
F5offset= "" & Question("File#5 Offset#")
Message(Fname5 & " AND G" & F5offset)
For x = 1 To 5
If x = 1 Then loadfile(fname1)
While Isloading()
Sleep(1000)
Wend
If X = 1 Then Code"G" & F1offset
Sleep(1000)
If x = 2 Then loadfile(fname2)
While Isloading()
Sleep(1000)
Wend
If X = 2 Then Code"G" & F2offset
Sleep(1000)
If x = 3 Then loadfile(fname3)
While Isloading()
Sleep(1000)
Wend
If X = 3 Then Code"G" & F3offset
Sleep(1000)
If x = 4 Then loadfile(fname4)
While Isloading()
Sleep(1000)
Wend
If X = 4 Then Code"G" & F4offset
Sleep(1000)
If x = 5 Then loadfile(fname4)
While Isloading()
Sleep(1000)
Wend
If X = 5 Then Code"G" & F5offset
Sleep(1000)
Message(filename)
While Isloading()
Sleep(5000)
Wend
runfile()
Sleep(2000)
While IsMoving()
Sleep(2000)
Wend
'Insert STOP code here
Next x
Message("thats all folks")
End
«
Last Edit: July 19, 2010, 11:30:33 PM by BR549
»
Logged
Ya-Nvr-No
Active Member
Offline
Posts: 268
Scuptris 3D
Re: Auto Batch Loader(;-)
«
Reply #1 on:
July 20, 2010, 06:19:55 AM »
Dim fname1,fname2,fname3,fname4,fname5 As String
Dim fn1WO,fn2WO,fn3WO,fn4WO,fn5WO As Single
fname1 ="c:\mach3\gcode\" & AskTextQuestion("File#1 Name?")
fn1WO= "" & Question("File#1 Work Offset#")
Message(Fname1 & " AND G" & fn1WO)
fname2 ="c:\mach3\gcode\" & AskTextQuestion("File#2 Name?")
fn2WO= "" & Question("File#2 Work Offset#")
Message(Fname2 & " AND G" & fn2WO)
fname3 ="c:\mach3\gcode\" & AskTextQuestion("File#3 Name?")
fn3WO= "" & Question("File#3 Work Offset#")
Message(Fname3 & " AND G" & fn3WO)
fname4 ="c:\mach3\gcode\" & AskTextQuestion("File#4 Name?")
fn4WO= "" & Question("File#4 Work Offset#")
Message(Fname4 & " AND G" & fn4WO)
fname5 ="c:\mach3\gcode\" & AskTextQuestion("File#5 Name?")
fn5WO= "" & Question("File#5 Work Offset#")
Message(Fname5 & " AND G" & fn5WO)
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(fname4)
If x = 5 Then loadfile(fname5)
While Isloading()
Sleep(5000)
Wend
If x = 1 Then Code"G" & fn1WO
If x = 2 Then Code"G" & fn2WO
If x = 3 Then Code"G" & fn3WO
If x = 4 Then Code"G" & fn4WO
If x = 5 Then Code"G" & fn5WO
Message(filename)
Sleep(2000)
runfile()
Sleep(2000)
While IsMoving()
Sleep(2000)
Wend
Next x
Message("thats all folks")
End
«
Last Edit: July 20, 2010, 06:34:44 AM by Ya-Nvr-No
»
Logged
BR549
Active Member
Offline
Posts: 2,553
Re: Auto Batch Loader(;-)
«
Reply #2 on:
July 20, 2010, 06:34:48 PM »
(;-) Lookin Mighty FINE . I ran it for hours on end last night (;-) It was still running this morning. I also tested what would happen IF you did not need the total number files(;-) only needed 3 file instead of 5. that work fine as well. just enter throught the rest of the questions and set the defaults.
So you could actually create a macro that did say 10 files. OR perhaps could create the number of files on the fly that you need to run??
Just a thought
Logged
BR549
Active Member
Offline
Posts: 2,553
Re: Auto Batch Loader(;-)
«
Reply #3 on:
July 20, 2010, 09:32:29 PM »
We do need an excape routine from the program though. (;-)
Logged
Ya-Nvr-No
Active Member
Offline
Posts: 268
Scuptris 3D
Re: Auto Batch Loader(;-)
«
Reply #4 on:
July 20, 2010, 10:00:33 PM »
While IsMoving()
Sleep(2000)
(somewhere here exit script if reset pushed)
Wend
I think we Need to get the Brain involved here somehow
Logged
BR549
Active Member
Offline
Posts: 2,553
Re: Auto Batch Loader(;-)
«
Reply #5 on:
July 21, 2010, 05:52:09 PM »
It would be best IF you can do a gracefull exit and it ALL be self contained in the one script. AND it NOT be a wait loop.
You can exit easy BUT then it attempts to run the NEXT program in line. AND you have to deal with the Gcode side as well as the VB side. SOmetimes they don't play nice together when you try to stop and it locks up mach.
Logged
BR549
Active Member
Offline
Posts: 2,553
Re: Auto Batch Loader(;-)
«
Reply #6 on:
July 31, 2010, 08:30:17 AM »
OK here are a few twqeaks to the routine. The Work Offsets are in G59P### format so you can use any of the 255 available. Also a tweak to allow the program to cycle through tool changes.
Now this works with programs that can run unattended. To stop the batch just feedhold/stop and that will cancel the batch and end the Batchload. To restart simply reload the batch from scratch. DO NOT FEEDHOLD unless you are cancelling the batch. There is an internal call from the Feedhold that will MESS up the WorkOffsetting big time.
I set this up as a button script and call the button AutoBatchLoader
NOTE: for this to work correctly you need to add this statment to your M1030 macro.
SetVar(601,0)
AUTO BATCH LOADER CODE **************************************************
' AutoBatchLoader macro
Dim fname1,fname2,fname3,fname4,fname5 As String
Dim F1WO,F2WO,F3WO,F4WO,F5WO As Single
fname1 ="c:\mach3\gcode\" & AskTextQuestion("File#1 Name?")
F1WO= "" & Question("File#1 Offset in G59 P### Format")
Message(Fname1 & " AND G59 P" & F1WO)
fname2 ="c:\mach3\gcode\" & AskTextQuestion("File#2 Name?")
F2WO= "" & Question("File#2 Offset in G59 P### Format")
Message(Fname2 & " AND G59 P" & F2WO)
fname3 ="c:\mach3\gcode\" & AskTextQuestion("File#3 Name?")
F3WO= "" & Question("File#3 Offset in G59 P### Format")
Message(Fname3 & " AND G59 P" & F3WO)
fname4 ="c:\mach3\gcode\" & AskTextQuestion("File#4 Name?")
F4WO= "" & Question("File#4 Offset in G59 P### Format")
Message(Fname4 & " AND G59 P" & F4WO)
fname5 ="c:\mach3\gcode\" & AskTextQuestion("File#5 Name?")
F5WO= "" & Question("File#5 Offset in G59 P### Format")
Message(Fname5 & " AND G59 P" & F5WO)
For x = 1 To 5
If x = 1 Then loadfile(fname1)
While Isloading()
Sleep(1000)
Wend
If X = 1 Then Code"G59 P" & F1WO
Sleep(1000)
SetVar(601,1)
Sleep(1000)
If x = 2 Then loadfile(fname2)
While Isloading()
Sleep(1000)
Wend
If X = 2 Then Code"G59 P" & F2WO
Sleep(1000)
SetVar(601,1)
Sleep(1000)
If x = 3 Then loadfile(fname3)
While Isloading()
Sleep(1000)
Wend
If X = 3 Then Code"G59 P" & F3WO
Sleep(1000)
SetVar(601,1)
Sleep(1000)
If x = 4 Then loadfile(fname4)
While Isloading()
Sleep(1000)
Wend
If X = 4 Then Code"G59 P" & F4WO
Sleep(1000)
SetVar(601,1)
Sleep(1000)
If x = 5 Then loadfile(fname4)
While Isloading()
Sleep(1000)
Wend
If X = 5 Then Code"G59 P" & F5WO
Sleep(1000)
Setvar(601,1)
Sleep(1000)
Message(filename)
While Isloading()
Sleep(5000)
Wend
runfile()
Sleep(2000)
While Getvar(601)=1
Sleep(2000)
Wend
If Getvar(601)=1 Then End
Next x
Message("End Of Batch Load")
End
Logged
Pages:
1
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...