Hello Guest it is March 28, 2024, 02:45:47 PM

Author Topic: Macro Pump  (Read 16324 times)

0 Members and 1 Guest are viewing this topic.

Offline fdos

*
  •  326 326
    • View Profile
Re: Macro Pump
« Reply #10 on: May 03, 2007, 02:26:03 PM »
I just setup the reset button in screen designer to run a script.

In mach put in that button

DoOembutton(1021)

DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 ) 

I can run it in the editor, and it resets Mach and Homes all axis.

BUT I can't get the bugger to remember the script.

Anyone give us a quick quide on button scripts and WTF do we save them as?

Wayne....

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Macro Pump
« Reply #11 on: May 03, 2007, 02:29:15 PM »
You can set the tickers like this :-

Sub SetTicker (number as Int, text as String)

number is from 1 to 255

text is any text you wish to display

e.g.         SetTicker 205, "This is a very long error message because you seem to have done something very silly"

Graham.
Without engineers the world stops

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Macro Pump
« Reply #12 on: May 03, 2007, 02:44:29 PM »
First load the screen set with the reset mod in to mach, go to 'operator' menu and select 'edit button script'.

Editable buttons will flash.

Select reset button on screen, editor will open, enter your code,

Make sure last line of script has a return on the end

Select save.

Graham.
Without engineers the world stops

Offline fdos

*
  •  326 326
    • View Profile
Re: Macro Pump
« Reply #13 on: May 03, 2007, 02:56:57 PM »
Graham

I got there in the end.

The code as above does not work as expected.   It does work ir resets mach and homes in debug mode in the editor.

But not from within Mach itself.   It just resets and ignores the rest.

Oh well. another method maybe.

I think the answer may be a custom screen set, an initial opening screen that expects a reset and then only allows homing.

Once homed goto the stock screensets.   Is that possible?  Hidden buttons maybe?

Wayne....

Offline zealous

*
  •  489 489
  • HI!
    • View Profile
    • Artsoft Solutions
Re: Macro Pump
« Reply #14 on: May 03, 2007, 04:16:11 PM »
I agree that going to another page will work best. The reason being is that it's hard to turn everything off but the refer home functionality in Mach; it would be just simpler to just go to a page.
I would be interested in how other people would go about doing this differently.

Try this:

value =  GetOEMLEd(807)
If  value = 1 Then
DoOEMButton (2) 
 Else
DoOEMButton (1)

End If

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Macro Pump
« Reply #15 on: May 03, 2007, 04:51:30 PM »
How come you dont put a "G28.1" in your intialization script, under the General config????  When you first Intialize Mach in the AM, and reset it, the first thing it will then do is Home.

Scott
fun times

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Macro Pump
« Reply #16 on: May 03, 2007, 04:54:57 PM »
If that doesn't work then put this in your reset button:

code "G28.1", then it will home after any reset also. (Or if you use G30, or G28 or what ever).

Scott
fun times

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Macro Pump
« Reply #17 on: May 03, 2007, 05:13:44 PM »
and perhaps a sample macro pump solution:

Macropump.m1s

'for seeing if machine is homed at reset (which it never is), and if not, then homing.

If Not GetUserLED(800) And Not GetUserLed(807) And Not GetUserLed(808) And Not GetUserLed(809) Then
DoButton(22)
DoButton(23)
DoButton(24)
End If

'Led 800 is the reset active led, 807-809 is the x/y/z axis referenced Led, (you can add the other 3 if you want)
'DoButton 1022-24 is home axis x/y/z

'There are also several more versions of this, via Bit lockouts from your home switches, that if they havent
'been made at start up, then Machs macro can also push the "Stop or Feedhold" button and make a ticker that
'tells your user to home first, via checking the home leds, and this would avoid the reset button represses.

Scott
« Last Edit: May 03, 2007, 05:19:54 PM by poppabear »
fun times

Offline fdos

*
  •  326 326
    • View Profile
Re: Macro Pump
« Reply #18 on: May 03, 2007, 05:47:52 PM »
OK Here's a bodged up "bastard child" solution LOL

I took the stock screenset and deleted just about all of it just to make it easy to MOVE page 1 to page 2.

Then created a simple page one with just a reset button and a home all button.

The home button has the following simple script in it.

estop = getoemled(800)

If estop = 0 Then

 DoButton( 24 )
 DoButton( 23 )
 DoButton( 22 )
 DoButton( 25 ) 

 dooembutton(2)

Else

 dooembutton (1)

End If   

It won't select unless Mach has been reset.   and when it is will home all and load screen two the ORGINAL screen 1.

It could be tarted up a bit with DRO's and Homed axis led's on that front page.


Sorry it's RUFF RUFF I don't have much time and must get back into the workshop.

Wayne....



Offline fdos

*
  •  326 326
    • View Profile
Re: Macro Pump
« Reply #19 on: May 04, 2007, 07:43:52 AM »
Scott

Homing after a reset as script on that button does not work as far as I tell.   Any code after the reset is ignored.  Makes sense in a way.

A g28.1 in init string did not work for me either.

The rough method I outlined above seems to work well as a test.

Wish it was easier to INSERT a screen in screen designer!  To save having to copy and paste all screens one place higher I just deleted the ones not need for this exercise.

Anyway I hope it gives the OP some ideas.   

Wayne....