Home
Downloads
Mach and LazyCam
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
German Forum
Italian Forum
Portugese Forum
Resources
Links
User Reviews
User Videos
Contact Us
CNCZone
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
December 02, 2008, 04:36:34 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
Switching T1 & T2 via button
Pages:
1
Go Down
« previous
next »
Author
Topic: Switching T1 & T2 via button (Read 672 times)
0 Members and 1 Guest are viewing this topic.
Azrael
Active Member
Online
Posts: 32
Switching T1 & T2 via button
«
on:
June 24, 2008, 06:34:11 PM »
Hello,
I was asking if it's possible to put a button into the main screen which switches between 2 tools instead of typing M6T1 & M6T2 into the MDI command line?
Regards,
Dejan
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Online
Posts: 770
Briceville, TN, USA
Re: Switching T1 & T2 via button
«
Reply #1 on:
June 24, 2008, 07:31:33 PM »
Yes there is, I will give you Two ways, one fixed the other user adjustable.
Fancy first:
Drop two user DROs on your Screen in screen designer, I.e. DRO 2000, and 2001
also drop a button label it tool change.
Drop TWO user LEDs (one by each Tool DRO above, label them ToolA, and
ToolB for instance), Use User LEDs 1500, and 1501
set UserLED 1500 next to the DRO 2000, and put UserLED 1501 next to DRO2001.
In the button put this script:
'*********start of button script**********
CurrentChoice = GetUserLED(1500)
ToolA=GetUserDRO(2000)
ToolB=GetUserDRO(2001)
If CurrentChoice then
SetUserLED(1500,0)
SetUserLED(1501,1)
Code "T" & ToolB & "M6"
Else
SetUserLED(1500,1)
SetUserLED(1501,0)
Code "T" & ToolA & "M6"
End IF
'*************End of button script*******
NON-Fancy (hard coded Tool call)
as above, but just drop ONE LED on the Screen and one button, (or tWO leds if you want labels by them to tell what tool is current.
IN a button put this code:
'*********start of button script**********
CurrentChoice = GetUserLED(1500)
If CurrentChoice then
SetUserLED(1500,0)
SetUserLED(1501,1) 'if your using two leds
Code "T1M6"
Else
SetUserLED(1500,1)
SetUserLED(1501,0) 'if your using two leds
Code "T2M6"
End IF
'*************End of button script*******
'hope this helps,
'scott
Logged
All things Mach3, Screens, Wizards, Plugins, Brians, complete control solutions for complex machines, Macros, ATC's, any kind of CNC machine build, retrofit or repair.
Azrael
Active Member
Online
Posts: 32
Re: Switching T1 & T2 via button
«
Reply #2 on:
June 25, 2008, 02:27:01 AM »
Hello Scott,
Thanks a lot. I have implemented 2nd code, it works. The only one thing missing is to prevent tool change while in reset and while the program is running. also I would like to change tool number displayed at existing the Current Tool Number DRO. And to release the tools when hit reset... Sorry for bothering, but this time I really need help :-)
Cheers,
Dejan
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Online
Posts: 770
Briceville, TN, USA
Re: Switching T1 & T2 via button
«
Reply #3 on:
June 25, 2008, 07:14:51 AM »
First I dont understand a few of your statements:
1). "The only one thing missing is to prevent tool change while in reset and while
the program is running"
This doesnt make since to me, because when you are in a Reset condition, you cant
run a M6 or any other code.
I can put a "Lock out" in the code below, so that if you are running a part and
you push the tool change button, that it will NOT execute........
But currently, if you code is running, and you have the
"Stop spindle and wait for cycle" Tick mark, ticked under your Config>Gen
Then even if that button is pressed, it stops your code running, and updates the
the tool DRO. So below, I will assume you want the button "Deactivated" if code is
presently running, if that is wrong then clairify your request.
ALSO: clairify what your concern is on the Reset condition...........
2). "also I would like to change tool number displayed at
existing the Current Tool Number DRO."
The Tool DRO already Updates to the Tool Number when you press the button that
you added for changing between tool1 and tool2, SO, I dont understand what your
saying since, when you push the toolchange button, the ToolDRO updates..... to
the tool that you flipped to.
3). "And to release the tools when hit reset... Sorry for bothering,
but this time I really need help :-)"
So if I understand this correctly, you want the Tool DRO (current tool), to goto
tool "0" when you hit the Reset button?
If that is correct I have modified the code below to do that.
CODE CHANGES:
1). Implemented that if the Code is currently running, that this button (Tool change button), will
disable.
2). Change code in "RESET" button, that when you push E-Stop/Reset Button, The Current Tool Number DRO will
Display "0".
NOTE: You will need to open up screen designer again, and add the code below to the "Tool Change" button.
You will also need to go to the "Park/Permenant" page of screen desiner to edit the Reset Button, the code
and procedure for that is below the Tool button script.
'*********start of button script**********
CurrentChoice = GetUserLED(1500)
If Not(GetOEMLED(804)) Then
If CurrentChoice Then
SetUserLED(1500,0)
SetUserLED(1501,1) 'if your using two leds if not remove this
Code "T1M6"
Else
SetUserLED(1500,1)
SetUserLED(1501,0) 'if your using two leds if not remove this
Code "T2M6"
End If
Else
Message("Stop machine running 1st")
End If
'*************End of button script*******
Reset Button Code Change so that when it is pushed your Tool DRO goes to "0"
NOTE: In screen designer 3 or 4, you will have to tick, the Execute VB script tick
button and put the below code in the box if using 3, save the screen open mach, and hit
view>load screen and load the one you just did.
in screen 4 tick the execute VB in mach3, and save.
you will need to open mach and load your changed screen, DONT reset yet, click
Operator>Edit Button script, your "Reset" button should start blinking, click on it
a VB window will open, put the script below in it, and hit SAVE on the VB window.
Close the VB window. Then hit View>Save Current Layout.
Also before going any further, open the button script again as above, sometimes the
VB doesnt stay, if not redo the above, and recheck again.
If you see the new code in the button, then that is good, just close the VB editor.
Now push your reset button, you will see your Tool DRO goto 0 (unless there already)
Inside the "Reset" button put this code:
'***start RESET button code******
SetOEMDRO(824,0)
DoOEMButton(1021)
'***end RESET button code*****
'Hope this fixes you up,
'scott
«
Last Edit: June 25, 2008, 07:22:10 AM by poppabear
»
Logged
All things Mach3, Screens, Wizards, Plugins, Brians, complete control solutions for complex machines, Macros, ATC's, any kind of CNC machine build, retrofit or repair.
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.
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*e*i*n*g
=> Mach Screens
=> Feature Requests
=> Non English Forums
=> FAQs
===> Finished Plugins for Download
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
-----------------------------
*****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
=> Lazy Cam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> dspMC/IP motion controller
=> Third party software and hardware support forums.
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Promote and discuss your product .
=> Sieg Machines
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
=> One on one phone support.
=> Forum suggestions and report forum problems.
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
Loading...