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?
November 20, 2008, 03:53:39 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
Brains Development
Terminate a brain with "run macro M650.m1s" ???????
Pages:
«
1
2
Go Down
« previous
next »
Author
Topic: Terminate a brain with "run macro M650.m1s" ??????? (Read 1303 times)
0 Members and 1 Guest are viewing this topic.
Greolt
Global Moderator
Online
Posts: 351
Re: Terminate a brain with "run macro M650.m1s" ???????
«
Reply #10 on:
February 25, 2008, 09:15:54 PM »
Well here is my attempt at a working macro.
No laughing allowed.
I could not grasp the "If Not" thing but this makes sense to me.
'Macropump to activate Auto Tool Zero (M650) from an external switch via input #4
'OEMled 824 or Input 4, will be normally active (1) until switch is pressed/closed (0)
A = GetOEMLed(824) ' Input 4 LED
B = GetOEMled(164) ' Spindle Rotating LED
C = GetOEMled(999) ' System movement Led
D = GetUserDRO(1500)
If A and B and C and D = 0 Then ' if every one of the three LEDs and one DRO are at zero then the M650 will be run
Code "M650"
SetUserDRO(1500,1)
End if
If A and D > 0 Then ' if the switch has not been released then A will still be at zero so this will act as a lockout
SetUserDRO(1500,0)
End if
What do you think?
Greg
«
Last Edit: February 25, 2008, 09:55:42 PM by Greolt
»
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Online
Posts: 760
Briceville, TN, USA
Re: Terminate a brain with "run macro M650.m1s" ???????
«
Reply #11 on:
February 26, 2008, 09:43:32 AM »
'First off, I would NEVER laugh at you, you can ask Brian, I started off not knowing a darn thing
'Like you I asked questions, and plugged at it and played with it, till I did know, still have alot to learn.
'Here is a correction to your macro below
'Macropump to activate Auto Tool Zero (M650) from an external switch via input #4
'OEMled 824 or Input 4, will be normally active (1) until switch is pressed/closed (0)
A = GetOEMLed(824) ' Input 4 LED
B = GetOEMled(164) ' Spindle Rotating LED
C = GetOEMled(999) ' System movement Led
D = GetUserDRO(1500)
If (A = 0) and (B = 0) and (C = 0) and (D = 0) Then ' if every one of the three LEDs and one DRO are at zero then the M650 will be run
Code "M650" 'The INput4 is pressed here and it locks out here
SetUserDRO(1500,1)
End if
If (A = 1) and (D > 0) Then ' if the switch has been released then A will be at 1 so this will unlock for next press
SetUserDRO(1500,0) 'the input4 switch has been released
End if
'scott
«
Last Edit: February 26, 2008, 09:48:06 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.
Greolt
Global Moderator
Online
Posts: 351
Re: Terminate a brain with "run macro M650.m1s" ???????
«
Reply #12 on:
February 26, 2008, 05:29:29 PM »
Thanks heaps Scott.
So I got it almost right except I did not know how the "and" statement worked.
That will mean I can have the Input #4 the more logical way. At rest = 0, Pressed = 1.
If (A = 1) and (B = 0) and (C = 0) and (D = 0) Then
If (A = 0) and (D > 0) Then
I only had it around the other way because I thought I needed it to make the "and" work in the first line.
I'm off to test this on my router.
Have in mind to build in a delay so that the switch must be pressed for one second before the M650 will run.
But I will get back to that. So beware of more questions soon.
Thanks again, Greg
Logged
Greolt
Global Moderator
Online
Posts: 351
Re: Terminate a brain with "run macro M650.m1s" ???????
«
Reply #13 on:
February 28, 2008, 07:44:47 AM »
Scott
I got it to work. Had to go with "IsActive(INPUT4)" as the "GetOEMLed(824)" would not work for some reason.
I tried to use "Ismoving()" instead of "GetOEMled (999)" to check for system movement but could not figure how to get it to work.
Any ideas?
Greg
'Macropump to activate Auto Tool Zero (M615) from an external switch via input #4
A = IsActive (INPUT4) ' Is switch pushed
B = GetOEMled (164) ' Spindle is Rotating LED
C = GetOEMled (999) ' System movement LED
D = GetUserDRO (1140)
If A And (B = 0) And (C = 0) And (D = 0) Then
Code "M615"
SetUserDRO(1140,1)
End If
If (A = 0) And (D > 0) Then
SetUserDRO(1140,0)
End If
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Online
Posts: 760
Briceville, TN, USA
Re: Terminate a brain with "run macro M650.m1s" ???????
«
Reply #14 on:
February 28, 2008, 08:32:58 AM »
try
C=IsMoving()
If A And (B = 0) And (C = Flase) And (D = 0) Then
Try these replacements see if it makes a difference, I havnt tested this, I am at work.
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.
Greolt
Global Moderator
Online
Posts: 351
Re: Terminate a brain with "run macro M650.m1s" ???????
«
Reply #15 on:
February 28, 2008, 08:46:40 AM »
Thanks Scott.
Will try in the morning. 1:00 AM here.
Greg
Logged
Greolt
Global Moderator
Online
Posts: 351
Re: Terminate a brain with "run macro M650.m1s" ???????
«
Reply #16 on:
February 28, 2008, 07:52:56 PM »
Scott
I have it all working as I wanted.
Using the brain to apply the switch delay (for safety)
Brain also takes care of checking that spindle and movement are not active (more safety)
Then hands it over to the macropump ( a simpler version now)
It has the interlock and triggers the M615
I have learnt some new stuff.
Thanks heaps for your help Scott
Greg
PS: that Ismoving() worked as you said but I'm not doing it that way now.
«
Last Edit: February 28, 2008, 07:55:41 PM by Greolt
»
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.
=> 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...