Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Flipz01 on May 02, 2007, 09:36:57 AM

Title: Macro Pump
Post by: Flipz01 on May 02, 2007, 09:36:57 AM
Where do I find a description of how to use a Macro Pump?
Title: Re: Macro Pump
Post by: Graham Waterworth on May 02, 2007, 12:11:56 PM
The macro pump is a list of VB commands stored in a file called MacroPump.m1s in the current profile.

Any valid VB script can be used.  The macropump runs about 40 times a second continually.  it must be enable in general config first and mach re-run to start the process.

What are you tring to do?. it may have been done already.

There is some info here :- http://www.artsoftcontrols.com/MachCustomizeWiki/index.php?search=macropump&go=Go

Graham.
Title: Re: Macro Pump
Post by: Flipz01 on May 02, 2007, 12:45:48 PM
I'm trying to make the operator "Home" the machine before anything can be done.  No problem there.  My biggest problem is finding documentation on how to set this up.

I'm assuming that I simply need to make the file in Notebook, put in the code, and turn the scan on in set-up.  But, I though I'd read up on this first.  I find references, but no "here's how you do it".

I've also been looking for info on how to set up userleds and tickers, and I've been looking for the place that Ticker0 is set up for the Reset switch.  Well hidden?
Title: Re: Macro Pump
Post by: Brian Barker on May 03, 2007, 09:55:15 AM
Please open up the wizards and check out the code in them. This will help you with how make the code work.

The best way to make the user have to home is to ad a bit of code to the cycle start button... I don't think you need to have anything in the Macropump

Thanks
Brian
Title: Re: Macro Pump
Post by: Flipz01 on May 03, 2007, 11:36:26 AM
Adding this to cycle start is not the idea.  I want to home the machine at startup, establish a 0,0 position against the limits, and then allow cutting parts.  You absolutely would not want to do this before ever part.

Code to do this is posted somewhere else on your Forum.

What I'm looking for is some basic "how to" regarding macro pumps, tickers, userLEds, etc.  Where can I find this stuff?
Title: Re: Macro Pump
Post by: Brian Barker on May 03, 2007, 12:10:21 PM
This is what I told you...

pseudo code :
If NOT homed
 DON'T run the code!!!!!
message "must be homed before running the program"
else
do cycle start


So as you can see it is going to do what you are looking for

If you still think you need all the macro pump stuff Please look at the code in the wizards and there screen sets. this will show you how everything works
Thanks
Brian
Title: Re: Macro Pump
Post by: Flipz01 on May 03, 2007, 12:25:57 PM
Brian, I get what you are saying, but we are an OEM.  If I were doing this for my shop, I'd do what you suggest, however, I want there to be NO CHOICE.  I want the machine homed, not as a suggestion, but as a requirement.  Once homed, it shouldn't be an issue, warning, or even a thought.  Apparently, the best way to do that is a macro pump file, but I can't find any info to base that decision on.

Any suggestions on where to look for advice on macro pumps, userLEDs, and tickers?  Apparently, others know how to do this so I'm guessing it's posted someplace.
Title: Re: Macro Pump
Post by: fdos on May 03, 2007, 01:04:16 PM
Could you not add it to the so called "reset" button?   Weird that reset is!   More like an E-Stop resets are usually coloured white too ;)

I do see what the OP is getting at, I was actually thinking about the same problem the other day.

I wonder if it's possible to code a reset in VB Script.

The way I'd like to have my machines set up is from power up.

Hardware reset (2 switches) That bits easy.   This would Enable drives.

Then force the Home. Before anything else is possible.  Is this what you mean?

Take as example the Heidenhain controllers so popular over here.  (Just happened to be repairing one today so this is fresh memory!)

On power up they are in a condition where they will do nothing. with the Alarm message "Shot Bolt Release"

Pressing the WHITE button will enable the machine and then the message

"Ref All Axes" comes up

CYCLE START is pressed and they home.

From there you can do whatever you like.

Wayne.....

Title: Re: Macro Pump
Post by: Graham Waterworth on May 03, 2007, 02:01:53 PM
This is where we got our info

http://www.artsoftcontrols.com/MachCustomizeWiki/index.php?title=Main_Page

Graham.
Title: Re: Macro Pump
Post by: Flipz01 on May 03, 2007, 02:21:22 PM
Wayne,

I think you are on the right track.

I think adding it to the reset button should work, I just don't know how to do it!

In my version, when Reset is hit, it would then say something like "Home the Machine".  But, I'd use a "Home" or "Datum" button instead of the "Cycle Start".
Title: Re: Macro Pump
Post by: fdos 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....
Title: Re: Macro Pump
Post by: Graham Waterworth 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.
Title: Re: Macro Pump
Post by: Graham Waterworth 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.
Title: Re: Macro Pump
Post by: fdos 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....

Title: Re: Macro Pump
Post by: zealous 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

Title: Re: Macro Pump
Post by: poppabear 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
Title: Re: Macro Pump
Post by: poppabear 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
Title: Re: Macro Pump
Post by: poppabear 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
Title: Re: Macro Pump
Post by: fdos 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....



Title: Re: Macro Pump
Post by: fdos 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....
Title: Re: Macro Pump
Post by: Flipz01 on May 04, 2007, 09:01:32 AM
Many thanks for all the help in deciding what to do here.  So you'll know, here's what I decided to do.


Page #1 has only a few things posted.  It has the Reset button, a Datum button (Seek home limits button), Ticker0, Ticker1, and Userlabel1.  That's it.

I left Ticker0 on all pages so it runs if you need to reset.  But to reset, you have to go to page #1.  Reset is ONLY on the first page.

I set the Reset button to run a VB Script.  The script says:

     SetTicker 1, "Press the Datum Button to Home the Machine"
     DoOEMButton(1021)

Note that I put the setticker line first, because it won't run otherwise.  So, what happens when my version of Mach3 boots is an initial screen that has a flashing Reset button, and Ticker0 is scrolling saying to "Press Reset".  When Reset is pushed, that starts the Ticker1 line telling the operator to "Press the Datum Button", and it enables the drives as usual.

The Datum Button on my system seeks the limit switches:

   rem DoButton( 24 )  (I don't have a Z-Axis on this machine)
   DoButton( 22 )
   DoButton( 23 )
   SetUserLabel 1, "Machine Homed"

Note that when the limits are found, I post a static Label that tells you that the machine "Homed" successfully.

This doesn't actually force seeking the limits before the machine will run.  I've decided that's OK.  I think the habit will be to seek the limits as instructed, but if you don't want to for some reason, you can skip that step.

Title: Re: Macro Pump
Post by: poppabear on May 04, 2007, 09:38:52 AM
Wayne,

Look at the Macro pump example I posted, it works on mine. (Unless I don't understand what your wanting to do).
It is in the my last post before this one.

Scott
Title: Re: Macro Pump
Post by: poppabear on May 04, 2007, 09:42:43 AM
Wyane,

   If forgot, the G28.1 (or G30), works in my init string, BUT, after I put it in the init string, I had to shut down and reboot mach, it worked after that..........
I have a G80 and a few others on my init string prior to the homing, I dont know if that makes a difference or not.

Scott
Title: Re: Macro Pump
Post by: fdos on May 04, 2007, 10:02:32 AM
Scott I don't want to do anything LOL..   It was someone elses thread ;)

Anyway, he's got a solution, kinda like the one I came up with, so glad to have been able to plant a seed leading to his answer.

Personally I'd rather macropumps have as little as possible in them.   Monolithic Macropumps could in theory never be completely executed.

Wayne....