What kind of a control are you using? It would help if you could post some code how you would program it long hand then we can write some loops for it.
Stevo
Can anyone help me, I need a macro to automate a pneumatic punch in my cnc program and I haven’t a clue where to start.
What information is needed to write a macro for this application ? Are there any templates around that I can have a look at to get me pointed in the right direction?
Any help will be much appreciated.
Regards
Colin
What kind of a control are you using? It would help if you could post some code how you would program it long hand then we can write some loops for it.
Stevo
The controller software i am thinking of using is Mach 3 , but will be programing
in Mastercam.
The machine will only have an X axis and the punch will be set fixed at the right position along the y axis and will not need to move. The material will move along the x axis to the correct position, then i would like to activate the punch from the program.
So basically the program will consist of G0 X axis moves to each hole position, then the macro to activate the punch at each hole position.
I hope this makes it a bit clearer.
Thanks again
I have never programmed Mach3 so this might not fit exact. Do you know if your control supports variables #1,#2, #100 ect.?
There is a few different ways that you can go about this. From what you have said the only variable from job to job will be the distance to travel in the X from punch to punch? And I would assume the number of punches in a given job? What is your code for activating the punch? I would look at programming it like this as long as the control can support IF,THEN,WHILE statements.
O0001(punch macro)
#100=1.2---------------hole to hole X distance
#101=50----------------number of holes to punch
WHILE[#101GT0]DO1
G0G91X#100-----------INCREMENTAL this can be set up absolute if you want
M123------------------code to activate the punch
#101=#101-1
END1
M30
This will keep looping through moving the X1.2" at a time then punching. It will do this 50 times or what ever you set #101 equal to. Then it will end.
Stevo
Stevo,
Thanks very much for your help, this has put me down the right
track.
Good I am glad to hear it. Let me know if need any help with the program or have questions on anything else.
Stevo