Hello Guest it is April 19, 2024, 02:35:47 PM

Author Topic: G code help  (Read 3100 times)

0 Members and 1 Guest are viewing this topic.

G code help
« on: October 15, 2007, 08:54:35 AM »
Hello all -

Newbie to CNC - please be kind.

After searching thru the archives for the past week - no luck.

I have a small PC board (1" X 2") that has 3 holes drilled in it.  It is
'step & repeated' into a 6 X 8 array.  Using "Excel" and 'copy & paste'
I have programmed the job.  Something like about 150 lines of code. 
It seems like there should be a step & repeat command to do the same thing.

Embarassing I have to admit that I was part owner in a PC board house -
just never got into the NC end of the manufacturing.

Octavio

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: G code help
« Reply #1 on: October 17, 2007, 08:34:06 AM »
Yes - I am used to programming a computer with sub-routines so I got caught as well.

There are two ways - Gcode has a subroutine call M98 and the subroutine returns to the main program with an M99 code.
You can set up a group of offsets to move the table, and then call the sub-routine to drill.

If it is just a drilling an array, then you might prefer to write a macro in visual basic, where you might like to write "for x = 1 to 6, for y = 1 to 8, drill x,y" . Thats not the whole program of course but it could be just a few lines like that. Store the macro, put your workpiece in place and just call the macro.

I have several Visual Basic macros I have written for rounding the ends of bars, thining down axles and rods etc that take information from a set of DRO's I have inserted on a page, then I can call the macro's from within any program, just for that one job - then carry on the rest of the program.

If you are drilling an array of holes, then I think the macro would be the simpler bet - is it for drilling electronics boards or something similar ?
Not me driving the engine - I'm better looking.
Re: G code help
« Reply #2 on: October 18, 2007, 07:45:57 AM »
Thanks Jim for the reply.

Indirectly it is for a PC board.

I will search the archives for info on using VB for suroutines.

Thanks again fo the help.

Octavio


Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: G code help
« Reply #3 on: October 19, 2007, 05:41:10 AM »
Have a look at the Tutorials (at the top of the page).

Follow it through to the Cantasia site and have a look at the one called "Scripting Intro" . It tells you how to do it.
Not me driving the engine - I'm better looking.
Re: G code help
« Reply #4 on: October 19, 2007, 08:47:05 AM »
Hi Jim,

Took me a while to find what you meant by the Cantasia site - almost gave up.

But I did finally find it and WOW - There is so much info there that I'll be viewing/learning
for many, many weeks/months.

Thanks for your time/response,
Octavio