Home
Downloads
Mach and LazyCam
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
German Forum
Italian Forum
Portugese Forum
Resources
Links
User Reviews
User Videos
Contact Us
CNCZone
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
December 01, 2008, 09:29:52 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
G-Code, CAD, and CAM
G-Code, CAD, and CAM discussions
Subroutine attempt
Pages:
1
Go Down
« previous
next »
Author
Topic: Subroutine attempt (Read 839 times)
0 Members and 1 Guest are viewing this topic.
tmsmith
Active Member
Offline
Posts: 104
Subroutine attempt
«
on:
May 28, 2008, 05:52:03 PM »
I am trying to use a subroutine to produce several copies of a part on a single piece of plate but with no obvious progress.
So far this is on the study PC not in the workshop.
Using the manual and answers on this type of problem given in the Forum I have written a program to cut two squares by calling a subroutine twice. If I run this program the sequence seems to jump the subroutine. If I single step through the program it still seems to skip the subroutine. If I start single stepping in the sub-routine it appears to execute correctly.
So my first question is - can such a program be single stepped through OK in Mach3 when correctly programmed?
I have also noticed that generally M98 & M99 are used but sometimes examples use G98 G99; are these typing errors?
Neither version helped me though.
tmsmith
Logged
Graham Waterworth
Administrator
Online
Posts: 1,173
West Yorkshire, England
Re: Subroutine attempt
«
Reply #1 on:
May 29, 2008, 01:19:43 PM »
Hi Malcolm,
firstly, the G98/G99 are typos, ignore them. G98 and G99 are used in drilling routines.
This is the basic layout of a program with a sub and a datum shift for more than 1 part on a plate:-
%
O0001 (MAIN PROGRAM)
G21 G40 G00 G80
N1 (FIRST TOOL)
T1 M6
G00 G90 G43 X0 Y0 Z25. H1 S2000 M3 (initial move)
M98 P0002 (call sub)
G52 X100. (shift local datum for second part)
M98 P0002 (call sub)
G52 X0 (cancel shift)
(do more shifts and sub calls here)
G00 Z25.(rapid safe)
M30
O0002 (SUB PROGRAM)
G00 X0 Y0
Z1.
G01 Z-10. F50.
G00 Z1.
M99
%
Try and get into the habit of putting the % signs top and bottom of the program code, the main reason for failing sub programs is that the carriage return is missing off of the last line.
Graham.
Logged
G-Code is on the cutting edge
Autovalues Engineering, CNC machining specialists, Bradford, England
tmsmith
Active Member
Offline
Posts: 104
Re: Subroutine attempt
«
Reply #2 on:
May 29, 2008, 05:25:07 PM »
Thanks Graham,
I will try your prog. tomorrow.
Malcolm
Logged
tmsmith
Active Member
Offline
Posts: 104
Re: Subroutine attempt
«
Reply #3 on:
May 30, 2008, 03:23:17 PM »
Graham,
I typed your code into 'Notepad' and loaded it into Mach3.
I have tried your code, ie simulated in Mach3, and of cause it worked fine in single stepping and normal run mode though the graphics showed it cutting the same part twice despite the G52 shift of origin (expected).
I then typed in my code, very similar to yours, but it would not jump into the subroutine!.
Checked it in 'Word' and all carriage returns seemed OK.
Tried various changes to the code but without success so getting quite frustrated.
Will hopefully attache my code and I wonder if you could look at it and let me know what the problem is.
Malcolm Smith
RectRepeat.txt
(0.45 KB - downloaded 24 times.)
Logged
Graham Waterworth
Administrator
Online
Posts: 1,173
West Yorkshire, England
Re: Subroutine attempt
«
Reply #4 on:
May 31, 2008, 02:36:39 AM »
Hi Malcolm,
try this version of your code, the only line that can not have a line number is the program number line eg. N105 O0002
This is true for the main program and any subs.
Graham.
RectRepeatMOD.txt
(0.45 KB - downloaded 31 times.)
«
Last Edit: May 31, 2008, 03:25:24 AM by Graham Waterworth
»
Logged
G-Code is on the cutting edge
Autovalues Engineering, CNC machining specialists, Bradford, England
tmsmith
Active Member
Offline
Posts: 104
Re: Subroutine attempt
«
Reply #5 on:
May 31, 2008, 04:46:51 PM »
Graham, You are a genius.
I dont recall seeing the info about the line numbers in the manual;and I always use them which explains everything.
Now I can stop banging my head against the wall.
thanks
Malcolm
Logged
tmsmith
Active Member
Offline
Posts: 104
Re: Subroutine attempt
«
Reply #6 on:
June 02, 2008, 05:12:54 PM »
It is in the manual. Read more carefully next time.
tmsmith
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*e*i*n*g
=> Mach Screens
=> Feature Requests
=> Non English Forums
=> FAQs
===> Finished Plugins for Download
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> Lazy Cam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> dspMC/IP motion controller
=> Third party software and hardware support forums.
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Promote and discuss your product .
=> Sieg Machines
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
=> One on one phone support.
=> Forum suggestions and report forum problems.
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
Loading...