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 28, 2012, 10:21:32 AM
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
Rookie needs some help.
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: Rookie needs some help. (Read 433 times)
0 Members and 1 Guest are viewing this topic.
SScnc
Active Member
Offline
Posts: 57
Rookie needs some help.
«
on:
December 07, 2011, 09:25:25 AM »
My VB skills are not so hot but I understand the idea of basic programs. Anyways I need some help with a script.
What I'm trying to do is when a tool change is initiated I want Mach to look at the current tool and the tool being called, and if they are the same, to ignore the tool change and start running the program. If they are different, go to my selected tool change position and then wait for a cycle start. I have the code working like I want except for a little hiccup. If I have the setting to "Stop spindle, wait for cycle start" it won't automatically start the program if the tools are the same value. If I have it set to "AutoTool Changer" it works great except when the tool values are different it goes to the tool change position and then immediately starts running the program, not giving me a chance to actually change the tool and then hit cycle start. Any help will be greatly appreciated.
Here's what I have
Sub Main()
X = GetUserDRO ( 1200 )
Z = GetUserDRO ( 1201 )
NewTool = GetSelectedTool
OldTool = GetCurrentTool
If NewTool = OldTool Then
Exit Sub
Else
Code "G53 G0 , Z" & Z
While IsMoving
Wend
Code "G53 G0 , X" & X
End If
End Sub
Thanks
Logged
ger21
Global Moderator
Online
Posts: 2,619
Re: Rookie needs some help.
«
Reply #1 on:
December 07, 2011, 11:43:40 AM »
I know why it doesn't work, but I'm not sure if it can be fixed. I believe the "Wait for Cycle Start" part is hard coded into mach3, so there's no way to avoid it?
With "Stop Spindle, Wait for Cycle Start", Mach3 is running two macros. M6 Start, then wait for the user, then M6 End. There's no code to get rid of the "wait for the user" part between the macros.
When using "Auto Tool Changer", Mach3 just runs the M6 Start macro.
What you could do is add the M6 End code to the M6 Start, and add a Message Box to pop up when you need to change tools. So instead of using Cycle Start to continue, you'd click OK in the message box to continue.
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
SScnc
Active Member
Offline
Posts: 57
Re: Rookie needs some help.
«
Reply #2 on:
December 07, 2011, 12:51:01 PM »
My M6End is empty. and the computer is not within arms reach of the machine. To have to go over and click 'okay' every time would be a PIA. Any other ideas?
Logged
ger21
Global Moderator
Online
Posts: 2,619
Re: Rookie needs some help.
«
Reply #3 on:
December 07, 2011, 03:40:26 PM »
I already told you.
Just add the MsgBox and set it to Auto Tool Change:
Sub Main()
X = GetUserDRO ( 1200 )
Z = GetUserDRO ( 1201 )
NewTool = GetSelectedTool
OldTool = GetCurrentTool
If NewTool = OldTool Then
Exit Sub
Else
Code "G53 G0 , Z" & Z
While IsMoving
Wend
Code "G53 G0 , X" & X
While IsMoving
Wend
MsgBox "Change Tool!!"
End If
End Sub
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
SScnc
Active Member
Offline
Posts: 57
Re: Rookie needs some help.
«
Reply #4 on:
December 08, 2011, 08:04:21 AM »
Sorry that's not how I want it setup. Thanks anyways.
Logged
ger21
Global Moderator
Online
Posts: 2,619
Re: Rookie needs some help.
«
Reply #5 on:
December 08, 2011, 09:04:06 AM »
To me it's almost exactly what you asked for, but you click a different button than Cycle Start.
I don't think it's possible to do butyou want, but if you figure out a way, please let us know.
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
BR549
Active Member
Online
Posts: 2,558
Re: Rookie needs some help.
«
Reply #6 on:
December 08, 2011, 09:30:13 AM »
THere are ways to do what you want BUT not what I would consider SAFE ways.
You DO NOT want to be working with a spindle changing tools out when in a CB software HOLD.
(;-) TP
Logged
ger21
Global Moderator
Online
Posts: 2,619
Re: Rookie needs some help.
«
Reply #7 on:
December 08, 2011, 09:59:20 AM »
Yes, I probably should have mentioned that.
However, even with the normal Mach3 "Wait for Cycle Start", I prefer some type of lockout while changing tools. With some setups, if the PC happens to crash (although extremely rare) it's possible for the spindle to start if you don't have a charge pump, but I wouldn't trust the charge pump with my hands either.
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
SScnc
Active Member
Offline
Posts: 57
Re: Rookie needs some help.
«
Reply #8 on:
December 08, 2011, 04:29:57 PM »
Well that might work for me because this is on a lathe and the spindle is manual control. How can I make this work?
Logged
SScnc
Active Member
Offline
Posts: 57
Re: Rookie needs some help.
«
Reply #9 on:
December 08, 2011, 04:32:02 PM »
Also I have a button for cycle start. Like I said the computer is not at a convenient location where I want to be pressing cycle start or clicking OK. I can see the screen from where I operate the machine but it's not within arms reach. I have all the controls I use right where I can reach them and watch the machine at the same time.
Logged
Pages:
1
2
»
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...