Hello Guest it is April 29, 2024, 01:50:09 PM

Author Topic: Subroutine calls not working  (Read 4666 times)

0 Members and 1 Guest are viewing this topic.

Subroutine calls not working
« on: May 10, 2012, 04:57:56 PM »
I am still at an early stage with G Code programming.  I am trying to use a subroutine to machine a chequerplate pattern and using G52 to shift the origin for repeating the pattern.

I have looked at several posts with similar problems but I can't see why my program just runs through the main code part without calling the subroutine.  What does the percent sign do?  Someone seemed to solve a problem by putting one at the end after the M99 but it doesn't make any difference to my program.

My syntax seems the same as the Mach3 manual.  What am I doing wrong?

File is attached.

Andrew
Re: Subroutine calls not working
« Reply #1 on: May 10, 2012, 05:11:38 PM »
Hi Andrew,
  One thing is, there can be no line numbers or spaces at the sub label.
See sample.

The % is just to insure that a carriage return was hit at the last line of the code.
Re: Subroutine calls not working
« Reply #2 on: May 10, 2012, 05:21:58 PM »
Ahhhhh!!   So simple and easy when you know how.

Program now works, thank you very much for your help.  The speed of your reply was amazing.

Very useful forum, hope this one helps others.

Regards,

Andrew
Re: Subroutine calls not working
« Reply #3 on: July 05, 2012, 08:23:01 PM »
I am new to the cnc world. I have built one out of mdf and 720 oz stepper motors using 1/2 10 ACME LEAD SCREWS.  Gecko drivers 203 and porter cable routers. I got my motors turning and I have had limited success using sheet cam. I recently got vectric 2 1/2 d and it works great. I finally feel like I am making real progress.
 The problem I am now having is when I make something like a sign using different tools I have to make 3 seperate files. when I use the same tool for all process's it works great. I don't really understand the post's above about writing in macro's , Their must be an easier way.
Re: Subroutine calls not working
« Reply #4 on: July 06, 2012, 04:00:04 AM »
Well done for getting the hardware to work!  Not sure what the problem is with your programming can you explain what you are trying to do?  I needed to use the subroutine feature of Mach3 to put a bit of code that was going to be repeated many times in a subroutine which was then called by the main part of the program, I didn't use the Mach3 macros in this case. My problem which was answered in this thread was incorrect syntax, simple!

Regards,

Andrew
Re: Subroutine calls not working
« Reply #5 on: July 06, 2012, 03:09:22 PM »
Thanks Andrew,
 Basicly I am trying to figure out how to make a sign or nameplate or any part that uses different tools for profiling,pocketing, drilling etc and load it at the same time into mach3. Vectric 2.5 D doesn't allow this. I have to make a different file for each toolpath that uses a different tool. If I use the same tool for all those operations , I can just save to Mach and run the part.  I am not sure what or where the subroutine feature is located in Mach. I was hoping to be able to load  the program with all toolpaths and be able to stop and change the tool as needed. Thanks again for any and all help. Are you a pilot? I see Piper 2010 as your screen name !
 
 Thanks,
 Craig
Re: Subroutine calls not working
« Reply #6 on: July 06, 2012, 03:28:47 PM »
Would it be possible to load a file such as a name plate using the same tool for all toolpath's and then edit the gcode to stop and change the tool at a specific point and if so how would I do this? Are there any other software programs that would do this for me. Thanks to all on this forum it is definately a great resource for begginers.


 THANKS,
 Craig
Re: Subroutine calls not working
« Reply #7 on: July 07, 2012, 06:35:16 AM »
I think I understand what you are trying to do now.  My knowledge is limited to programming directly in G code and I think that your suggestion to take the Vectric output might give you a starting point with a G code program which you could then alter to do what you want i.e. put in halts with M01 and document the tool changes in the program code might work but I think you would have to alter the tool offsets and it would get awfully complicated. I am assuming your machine does not run to automatic tool changing.   I am on a learning curve with Mach3 and only program directly in G code although I have a copy of BobCAD which will take a drawing and produce the G code and will implement tool changes but I have not had time to learn how to use it yet.

I think you perhaps need to angle your enquiry in a slightly different forum which is read by Vectric experts because Mach3 is not your problem it is persuading Vectric to do what you want without resorting to programming directly in G code.  The subroutine is merely a programming feature in G code, for more information look at the documentation on the Artsoft website.

If anyone disagrees with this suggestion please contribute to this thread.  Otherwise I should have a look at CNCzone for a Vectric forum.

Piper relates to my musical rather than my aeronautical activities.  I play the Great Highland Bagpipes.

Best Wishes,
Andrew

 
Re: Subroutine calls not working
« Reply #8 on: July 07, 2012, 03:07:11 PM »
I'm thinking your best bet would be to set mach to stop on tool change and used vectrics mach/atc post processor.

I've never done it but think it would be worth looking into it

John