Author Topic: What is a Macro? and what can it do for me?  (Read 38734 times)

0 Members and 2 Guests are viewing this topic.

Offline Apples

  • Active Member
  • Posts: 22
    • View Profile
What is a Macro? and what can it do for me?
« on: February 17, 2009, 10:32:20 PM »
What is a Macro?  and what can it fo for me?

I'm thinking a macro is a pre saved snipped of code that is entered into the standard g code where ever you need
it so that you only type in the one line instead of heaps of lines of code every time you need to do the same command.

Is this correct?  or am I off with the fairy's?

Peter

Offline Graham Waterworth

  • Administrator
  • *
  • Posts: 1,837
  • West Yorkshire, England
    • View Profile
    • Autovalues Engineering
Re: What is a Macro? and what can it do for me?
« Reply #1 on: February 19, 2009, 03:31:35 AM »
You are sort of there, what you are talking about is a g-code sub program, a macro is a block of visual basic code that is called with an M code and a list of variables that can be changed on the fly. The macro in effect writes the g-code to do the function.  Macros can also be used to configure/drive machine functions, tool changers etc.

Graham
G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England

Offline Apples

  • Active Member
  • Posts: 22
    • View Profile
Re: What is a Macro? and what can it do for me?
« Reply #2 on: February 19, 2009, 06:28:16 AM »
Hmm,  okay I'll tell you what I'm thinking of doing and maybe you can point me in the right direction.


So imagine a 3 axis machine.  Then on the bottom/ underside of the z there is another axis a,b or c?  For tangential knife function.
Then under that is another axis a,b or c?  I don't know which axis  is which.  anyway.

The two axis underneath the z will just need to be used as, I think they call it just as "indexers"

1.  So I want to move machine to start position. 
2.  Then move tangential axis (a) (rotate to say 90deg.)
3.. Then move other axis (b) (say 90deg. as well)
  This above part is what I want maybe make into a macro or as you called it a sub program.

4.  Then when the tool is in that position move to next position.
5.  Maybe have to change angles of a and b axis to something else then move on agian etc.

So the part I want to not have to keep punching into g-code will be that a,b axis (index) tool position.
This might be like a tool change macro?

Also those a,b angle adjustments will be different.  There might be 3 or 4 diffent combitnations or,
a,b axis moves to do.

Do you understand?

Peter
Australia

Offline Graham Waterworth

  • Administrator
  • *
  • Posts: 1,837
  • West Yorkshire, England
    • View Profile
    • Autovalues Engineering
Re: What is a Macro? and what can it do for me?
« Reply #3 on: February 19, 2009, 12:12:29 PM »
Yes and no.

What is the difference between typing A90. and M590 ?

You will save nothing.

Graham
G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England

Offline machininginc

  • Active Member
  • Posts: 10
    • View Profile
Re: What is a Macro? and what can it do for me?
« Reply #4 on: July 17, 2009, 04:31:16 PM »
Where are the macros on mach 3 software  and can they be changed, I have a demo version so maybe not ? (not sure) I wanna set it up to use H#148 for a tool height & D#148 for the dia

Offline machininginc

  • Active Member
  • Posts: 10
    • View Profile
Re: What is a Macro? and what can it do for me?
« Reply #5 on: July 17, 2009, 04:57:58 PM »

 Here is the way I wanna program my mach 3 mill is it possiible and how can I set this up, also how can I look at my sub-rutines

T1 (#1 X 90 CENTER)
M6
M1
G80G90G40G00G54S2000M3
#148=#51999
G43X0Y0Z1.H#148T2M8
G83Z-.07R.1F4.Q.05L0
M98P20
G00G80Z1.M9
G91G28Z0Y0
M1
T2 (1/16 DRILL)
M6
M1
G80G90G40G00G54S4000M3
#148=#51999                                           (wanna use these variables or macros)
G43X0Y0Z1.H#148T3M8
G83Z-.2R.1F10.0Q.05L0
M98P20
G00G80Z1.M9
G91G28Z0Y0
M00 (CLEAR CHIPS FROM DRILL)
T3 (1/16 CEM)
M6
M1
G80G90G40G00G54S4000M3
#148=#51999
G43X0Y0Z1.D#148H#148T1M8
G66P21Z-.15D#148F5.
M98P20
G67
G00G80Z1.M9
G00A0.
G91G28Z0Y0
M30

vmax549

  • Guest
Re: What is a Macro? and what can it do for me?
« Reply #6 on: July 17, 2009, 06:04:16 PM »
SORRY but that is a mess.  I have no idea of what you are trying to do other than drill some holes.

Also there are some gcodes you called that do not exist in mach.

I would suggest you set down with the mach manual and work out what you want to do.

OR better explain what iit is you are trying to do.( Drawings work well here). AND we will try to help

Sorry (;-) TP

Offline machininginc

  • Active Member
  • Posts: 10
    • View Profile
Re: What is a Macro? and what can it do for me?
« Reply #7 on: July 17, 2009, 09:51:51 PM »
I'm brand new wiith mach, so I appoloigize if this sounds dumb, what do I do first to load a program, I have been able to draw in Gibbs and generate a program using a haas post processer, that gives me my code then I have been coping and pasteing into the edit screen on mach that will load it, however I'm not gettin any tool path and I can't veiw my sub programs

Offline Chip

  • Global Moderator
  • *
  • Posts: 2,057
  • Gainesville Florida USA
    • View Profile
Re: What is a Macro? and what can it do for me?
« Reply #8 on: July 17, 2009, 10:12:03 PM »
Hi, Machininginc

Try using a Fanuc Post I think it's close to what Mach want's at this time, I can see you've found yourself in a little different world at the moment.

Hears a link to a some what outdated manual, http://www.machsupport.com/docs/Mach3Mill_1.84.pdf

Under File, Load G-Code, Use this to load a G-code file by Browsing to C:\Mach3\GCode folder and select a file, Pic's below.

Hears some G-code to cut and past, It will take a little time for things to sink in, But will work thought it..

%
G90 G20 G61 G80 G40  ;  I added these to make sure Mach is configured for it to run
N5 (File Name = test55Dotpolyline 12 04 06 A1 on Friday, July 17, 2009)
N10 (Default Mill Post)
N15  G91.1
N20 G0  Z0.1000
N25 M3 S3000
N30  X0.0000  Y0.5000
N35 G1  Z-0.1000  F1.00
N40  Y1.0000  
N45  X1.0000  
N50  Y0.0000  
N55  X0.0000  
N60  Y0.5000  
N65 G0  Z0.1000
N70  X1.5000  Y0.7500
N75 G1  Z-0.1000  
N80  Y1.0000  
N85  X2.0000  
N90  Y0.5000  
N95  X1.5000  
N100  Y0.7500  
N105 G0  Z0.1000
N110  X1.4980  Y2.0080
N115 G1  Z-0.1000  
N120 G2  X2.5020  Y2.0080  I0.5020  J-0.0000
N125  X1.4980  Y2.0080  I-0.5020  J0.0000
N130 G0  Z0.1000
N135  X3.0000  Y1.0040
N140 G1  Z-0.1000  
N145  X4.0000  Y2.0080  
N150  Y0.0000  
N155  X2.0000  
N160  X3.0000  Y1.0040  
N165 G0  Z0.1000
N170  
N175  Y1.2500
N180 G81  X3.0000  Y1.2500  Z-0.1000  R0.1000  F1.00
N185 X3.7500  Y2.0000
N190  Y2.7500
N195 X0.2500
N200  Y1.5000
N205 G80
N210 G0
N215  S3000
N220  X2.7500  Y1.2500
N225 G1  Z-0.1000  
N230  X0.2500  
N235 G2  X0.0000  Y1.5000  I0.0003  J0.2500
N240 G1  Y2.7500  
N245 G2  X0.2500  Y3.0000  I0.2500  J-0.0002
N250 G1  X3.7500  
N255 G2  X4.0000  Y2.7500  I0.0000  J-0.2500
N260 G1  Y2.2500  
N265 G0  Z0.1000
N270 M5
N275 M30
%

Welcome to the Group, Chip.
« Last Edit: July 17, 2009, 11:29:33 PM by Chip »

Offline machininginc

  • Active Member
  • Posts: 10
    • View Profile
Re: What is a Macro? and what can it do for me?
« Reply #9 on: July 17, 2009, 11:33:32 PM »
I tried to run the program and it thru a alarm  of default mill post what do this mean, It ran about half way thru