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 23, 2012, 02:35:29 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
Code to check spindle and cycle start ON
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: Code to check spindle and cycle start ON (Read 1847 times)
0 Members and 1 Guest are viewing this topic.
SailFl
Active Member
Offline
Posts: 59
Code to check spindle and cycle start ON
«
on:
January 19, 2009, 08:43:38 AM »
I am not sure I am using the right code to check that the spindle is on or that cycle start (gcode running) is correct. When I test on my computer it works but when I test on my CNC machiine the spindle works but the cycle start allows the macro to run. Am I using the wrong code or what might be happening or is there a better way to do this. What I am trying to accomplish is that if the spindle is running or gcode is running, I do not want to allow a macro to run.
Code:
' Check to see if Cycle Start or Spindle is active
' If active then exit macro.
If GetOEMLED(11) Or GetOEMLED(804) Then
If GetOEMLED(11) Then
Code "(Spindle Active - Zero Touch Plate Macro Aborted)"
End If
If GetOEMLED(804) Then
Code "(Cycle Start Active - Zero Touch Plate Macro Aborted)"
End If
Else
Thanks for input
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Code to check spindle and cycle start ON
«
Reply #1 on:
January 21, 2009, 08:47:45 AM »
Well for one thing, your not putting out any info so that the other Macro can NOT run under those conditions.
here is your code with one possible solution, there are other ways as well.
'I recommend you can put this VB in your macro pump, since you need messaging.
'I added other conditionals to your messaging to handle the other possibles.
' Check to see if Cycle Start or Spindle is active
' If active then exit macro.
If GetOEMLED(11) Or GetOEMLED(804) Then
If GetOEMLED(11) and Not GetOEMLED(804) Then
Code "(Spindle Active - Zero Touch Plate Macro Aborted)"
End If
If GetOEMLED(804) and Not GetOEMLED(11) Then
Code "(Cycle Start Active - Zero Touch Plate Macro Aborted)"
End If
If GetOEMLED(804) and GetOEMLED(11) Then
Code "(G-Code and Spindle Running - Zero Touch Plate Macro Aborted)"
End If
SetUserLED(2000,1) ' This will set a User LED to ON, and it will be your
'control LED for your Probing Macro when ON, your Probe macro
'will not run.
Else
SetUserLED(2000,0) ' This will set a User LED to Off, when off your Probe will run.
'your other code here
End If
'/////////////////////////////////////////////////////////////////////////////////////////
'Now in your Probing Macro put this:
Sub Main()
If GetUserLED(2000) Then
Exit Sub
Else
'Your Probing Code here
End If
End Sub
Main
'enjoy scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
SailFl
Active Member
Offline
Posts: 59
Re: Code to check spindle and cycle start ON
«
Reply #2 on:
January 21, 2009, 09:06:14 AM »
poppabear,
Thanks for responding. Since I have not learned all the codes, I am not sure I understand one part of your solution.
Let me also give you some more details. For my Zero Touch Plate, I am not using a mach screen for input or results. I have added an LED to the touch plate. Before running the ZTP macro from my Shuttle Pro, I touch the plate to the bit. If the LED turns blue (the color of the LED), I know I will not drive the bit throught the touch plate. I then can run the macro.
What I realized is that with out some code to check if the spindle or a cut file is running, if I accidently pushed the ZTP button on the shuttle pro, I could have the macro run at a bad time while I am trying to cut a file.
So I do not have a user LED but I will try you have suggested.
I know that my code for the spindle is correct because the macro aborts when only the spindle is active. But if the spindle is off and I engage Cycle Start and then run the macro, the macro will not abort and it starts to do a ZTP run. I realize that the chances that I have code running and the spindle is off is rare but my past programming experience I program this way.
Since I have not worked with Mach that much, I am not sure why this is happening.
Does that help?
I also do not understand this comment. "Well for one thing, your not putting out any info so that the other Macro can NOT run under those conditions." Could you explain?
Thanks for your help.
«
Last Edit: January 21, 2009, 09:16:18 AM by SailFl
»
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Code to check spindle and cycle start ON
«
Reply #3 on:
January 21, 2009, 06:30:35 PM »
Just pick a User LED, for your control LED, it doesnt even have to exist on your screen.
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
SailFl
Active Member
Offline
Posts: 59
Re: Code to check spindle and cycle start ON
«
Reply #4 on:
January 21, 2009, 07:06:10 PM »
Scott,
Thanks for your help but you are not answering my questions so I still don't understand. If you don't have the time to answer my questions that is okay but I am not just looking for a solution but understanding.
Regards
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Code to check spindle and cycle start ON
«
Reply #5 on:
January 22, 2009, 08:42:45 AM »
I dont understand your questions, that is why I put the Questioning smiley
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
SailFl
Active Member
Offline
Posts: 59
Re: Code to check spindle and cycle start ON
«
Reply #6 on:
January 22, 2009, 09:04:41 AM »
Your first response, you tell me to SetUserLED. That is where it comes from.
"Well for one thing, your not putting out any info so that the other Macro can NOT run under those conditions." You aslo made this comment and I don't understand what you mean.
«
Last Edit: January 22, 2009, 09:06:26 AM by SailFl
»
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Code to check spindle and cycle start ON
«
Reply #7 on:
January 22, 2009, 09:13:16 AM »
ah, that is much clearer.
In your first code you posted (I am assuming it is running in Macropump?), when your conditions are met to NOT run your probing macro, you do not have a method to pass the "dont run" information so another macro, or brain could use that.
So, in mach you have 2,256 User LEDs that you can use for your purposes, you could also use UserDROs, or "Vars" any of them would do. LEDs are simple cause they are on or off. Further, even if you control an LED, you dont have to physically SHOW the LED on any of your screens, you can use it "invisibly" so to speak.
So what I was telling you was in your main code to set a User LED to ON, when you dont want the Probing cycle to run, and that same code would set it to OFF when you do want the probing to be able to run.
Your Probing Macro, written as a SUB (so you can exit), is watching that same LED, if it is on and you try to run the Probing script, then it will EXIT and not run. If the LED is OFF, it WILL run.
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
SailFl
Active Member
Offline
Posts: 59
Re: Code to check spindle and cycle start ON
«
Reply #8 on:
January 22, 2009, 09:32:19 AM »
Scott,
Why would you assume that it is running in macropump? It is my understanding that in macropump, macros run all the time or that is the what I learned watching the video.
Where is the a list of the user LED, DRO and Vars? I did not know that.
From your third line, it appears that the macro does not run all the time in the macropump and you can turn it on and off.
So let me see if I understand this correctly. This is what I understand.
The code that checks to see if the spindle and cycle start are active along with setting the User LED on or off based on the if else statement is located in my macro that I call with I push the button on my shuttle pro. The actual ZTP probe code that will do the work resides in a macro in the macropump and runs only when the user defined LED is turned off.
If this is correct, point me to the information that tells me how to place the macro in the macropump. Also the list of user LED, DRO and Vars.
I have another question...... I think some one said that the macropump will not allow another macro to run if the gcode is running so do I need to check if the spindle or cycle start is active. Don't I just have to turn the User LED off?
Thank you. This is what I needed to know.
«
Last Edit: January 22, 2009, 09:47:25 AM by SailFl
»
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Code to check spindle and cycle start ON
«
Reply #9 on:
January 22, 2009, 05:44:38 PM »
no
the first code I gave you should run in the macropump,
it is assumed that your probing code is inside a button, and when you push it, it will Run or Not depending on the state of the LED.
I dont fool with the shuttle pro, so you will need to get someone else to help you there.........
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
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...