Hello Guest it is March 08, 2021, 05:14:03 AM

Author Topic: Activating macros with more than one oem triggers  (Read 14472 times)

0 Members and 1 Guest are viewing this topic.

Activating macros with more than one oem triggers
« on: November 10, 2008, 11:13:56 PM »
Hi All,
Does anyone know If theres anyway to activate different macro`s with different oem triggers?
I have searched alot of the threads ,with no luck.
From what I have read,you can only use the one oem trigger to run only one Macro,
is this correct???

Problem is I have a pendant providing button inputs to a BB, which inturn I would like
to activate,
 1.Auto Z zero routine (macro)
 2.Auto zero xy offset routine,(from laser guidance).

Any help or ideas would be great,
OR   maybe there is a brain routine out there ....somewhere?


Thanks
regards
Whatda?

Offline Greolt

*
  •  956 956
    • View Profile
Re: Activating macros with more than one oem triggers
« Reply #1 on: November 11, 2008, 05:53:00 AM »
Whatda

Fairly sure you can do this with a macropump and a brain for each macro call.  Unfortunately I am not the one to ask how. :)

Poppabear will most likely be able to set you on the right track.

Greg

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Activating macros with more than one oem triggers
« Reply #2 on: November 11, 2008, 11:07:17 AM »
Greg, thanks for the plug...........hehehee

Whatda, Like Greg said above (BTW he sales himself short he is Dead on with what he is telling you).

You can do it in a Brain, or Macro pump, or both........

I can help you but you will need to define what you want the Macros to do, perhaps post the two macros you want to activate here with their code. From the Code we can see what things can be done in Brians and what can be done in Macropump or both.........

scott

Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
Re: Activating macros with more than one oem triggers
« Reply #3 on: November 11, 2008, 04:13:21 PM »
Thanks guys,

Macro one... (auto  Z zero ) activated somehow from oem trigger6


CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' two second delay
Code "G31 Z-20 F100" 'Z goes down a max of 20mm at 100mm/min
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z20" 'retract Z to 20 mm
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If



Macro Two... (auto zero XY from a offset laser) activated somehow from oem trigger5


Xmove = GetUserDRO(1152) 'X distance DRO
Ymove = GetUserDRO(1153) 'Y distance DRO

Code "G91 G0 X" &Xmove & "Y" &Ymove
While IsMoving ()
Wend
Code "G90 M9"
DoOEMButton (1008)
DoOEMButton (1009)


For info I am already using one initialization string (gen. config. page)
for activation of another macro (homing routine) via brtains.
And I cant see that you can use more than one ,ie this way.

Any help on this macro pump/brains would be excellent.


Thanks
Regards

Whatda?

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Activating macros with more than one oem triggers
« Reply #4 on: November 11, 2008, 06:14:51 PM »
Oh.........ok

Put this in your Macro pump:

CounterFIVE = GetUserDRO(2100)
CounterSIX = GetUserDRO(2101)

If IsActive(OEMTRIGGER5) and CounterFIVE = 0 Then
Code "M*********"  'put your auto Z zero macro number here
CounterFIVE = 1
End If

If NOT(IsActive(OEMTRIGGER5)) and CounterFIVE = 1 Then
CounterFIVE = 0
End If


If IsActive(OEMTRIGGER6) and CounterSIX = 0 Then
Code "M*********"  'put your auto XY zero macro number here
CounterSIX = 1
End If

If NOT(IsActive(OEMTRIGGER6)) and CounterSIX = 1 Then
CounterSIX = 0
End If

'scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline Greolt

*
  •  956 956
    • View Profile
Re: Activating macros with more than one oem triggers
« Reply #5 on: November 11, 2008, 06:36:33 PM »
Here is my try at it. Though I recommend you take Poppabear's more professional guidance.

As far as I know a brain can not trigger a macro on it's own.  So the macropump does that.

However brains are a no brainer to implement safety timers and lockouts.  (pun intended)  ;D

The two macros that you posted need to be placed in the macro folder with the name of your profile.  Eg.  Mach3Mill

Call them  M615.m1s  and  M616.m1s

The macropump calls the relevant macro when a user LED goes active. 

It basically is one which Poppabear wrote for me a while ago.  Much the same as posted above.

The brain sets the LED when the switch is pushed and held for 1.5 seconds but only if there is no motion,  the spindle is not running and reset is not active.

Being an external momentary switch I think the 1.5 second delay is a good safety measure.   

This means you must push and hold the switch for 1.5 seconds before anything will happen.

Do not want unintentional activation of either macro.

So the addition of the brain is just to allow for easy implementation of the safety lockouts.

Now take note I have done this as a learning exercise for myself.  Have a look but rely on Poppabear for proper advise.  :D


Greg
Re: Activating macros with more than one oem triggers
« Reply #6 on: November 11, 2008, 09:47:36 PM »
Thanks very much for looking into this for me,
But I plugged it all in and nothing?
I think I have a basic idea of the processes but
 I must be missing something.(please bare with me, my half neuron is working over time)!

From what I gather , the macro`s run when either User led is activated,(from one of the Triggers),
I like the safety timer idea,excellent!
so far so good I hope????

So therefore I have to display/install a "User"Led on my screen ,
 how then would  I assign it a code . (eg GETOEMLED 1140)
I have looked at screen4 and I cant see how you do that?
A = GetOEMled (1140)
B = GetUserDRO (1140)
C = GetOEMled (1141)
D = GetUserDRO (1141)




And as you have shown on yours, Scott the macro pump  below,
which is  indicated as UserDROs ( which Iam not familar with also)

CounterFIVE = GetUserDRO(2100)
CounterSIX = GetUserDRO(2101)
Sorry but Iam not sure what these lines or numbers (ie 2100) should do either.

In the mean time I will go back to the books and try and figure this out,
Thanks for your efforts.


Greg ,That brain you posted ,looks great ,
I wish I knew what it all means? very impresive!!


Regards
Whatda?

Offline Greolt

*
  •  956 956
    • View Profile
Re: Activating macros with more than one oem triggers
« Reply #7 on: November 11, 2008, 09:51:25 PM »
Whatda

Those User LEDs and DROs don't need to exist on screen.

Mach will just use them in the background.

Greg

EDIT:  Did you place the macro pump in the macro folder and activate it in General Config?  (Then Restart)
« Last Edit: November 11, 2008, 09:53:31 PM by Greolt »

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Activating macros with more than one oem triggers
« Reply #8 on: November 11, 2008, 10:34:51 PM »
Go Get Um Greg!!! U DA Man!!!!

whatcha:  the Udros are used as interlocks so that the code runs only Once per button push, since the Macropump has a nonstop scanner once you enable it, the interlocks will not let the code execute more than once per push/release.

if safety is an issue, in the code in the Macro pump you can add "and" 's into the if statement like NotGetOEMLED800 to make sure the estop is not on ect.

scott
« Last Edit: November 11, 2008, 10:44:53 PM by poppabear »
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline Greolt

*
  •  956 956
    • View Profile
Re: Activating macros with more than one oem triggers
« Reply #9 on: November 11, 2008, 10:40:00 PM »
 ;D ;D Your taking the mickey out on me aren't you Scott.   ;D ;D

Seriously though, I for one appreciate all the help you give here and on other forums.

Greg