Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 02:23: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
Mach Discussion
General Mach Discussion
Locating question
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: Locating question (Read 767 times)
0 Members and 1 Guest are viewing this topic.
rdean
Active Member
Offline
Posts: 23
Locating question
«
on:
January 16, 2011, 08:16:08 AM »
I hope I am posting this in the correct section of the forum.
I have a question about moving around the work piece and running different G codes.
I will try to explain but I may be trying to do something that is not practical.
Example:
G code #1 starts at 0,0 and cuts a rectangle that is 2"X4"
I have a work piece that is 12" square in the machine and the starting point is located at the center of the piece with the DROs at 0,0
I run code #1 at this location and when finished I want to move to another location and run this code again. In other words I want to cut many rectangles out out this piece with out loosing my original location of 0,0 and not having to change the G code.
Thank you
Ray
Logged
Dan13
Active Member
Offline
Posts: 759
Re: Locating question
«
Reply #1 on:
January 16, 2011, 09:56:24 AM »
Hi Ray,
The best option is using the G52 offset. Suppose you cut the first one at X0 Y0. Then you want another one at X-3 Y0 and next one at X3 Y0. This is how the program will look like:
(your code to cut rectangle here)
G0 X-3 Y0
G52 X-3 (this will offset the current point by -3 making it X0. Y remains the same)
(your code to cut rectangle here)
G52 X0 (set the offset back to zero)
G0 X3 Y0
G52 X3
(your code to cut rectangle here)
G52 X0
M30
In the same way you can offset in the Y as well.
Dan
Logged
HimyKabibble
V4 Screen Contributor
Offline
Posts: 1,347
Re: Locating question
«
Reply #2 on:
January 16, 2011, 10:28:30 AM »
And, if you put the code to cut the rectangle in a subroutine, you don't need to repeat the code, just call the subroutine after applying each offset.
Regards,
Ray L.
Logged
Regards,
Ray L.
Hood
Active Member
Offline
Posts: 17,362
Carnoustie, Scotland
Re: Locating question
«
Reply #3 on:
January 16, 2011, 11:21:36 AM »
There is also a wizard (called nesting if I recall) for doing this, i have not used it since Mach2 days but never heard of it not working but test with caution in case
Hood
Logged
rdean
Active Member
Offline
Posts: 23
Re: Locating question
«
Reply #4 on:
January 16, 2011, 12:39:25 PM »
Thank you for the replies.
I think the sub routine may be the way I want to go as I will be cutting different sizes and shapes.
Where can I find information on this subject?
I read though the Mach 3 manual and watched most of the videos but didn't find anything.
Any direction will be appreciated.
Ray
Logged
HimyKabibble
V4 Screen Contributor
Offline
Posts: 1,347
Re: Locating question
«
Reply #5 on:
January 16, 2011, 12:53:21 PM »
Your answer is only a Google away....
http://lmgtfy.com/?q=G-code+subroutine
Logged
Regards,
Ray L.
rdean
Active Member
Offline
Posts: 23
Re: Locating question
«
Reply #6 on:
January 16, 2011, 06:40:06 PM »
I went to the different web sites and I did learn how to add a subroutine and number it at the end of the program. I understand how to call it and how to loop it.
My subroutine is a file on my computer.
I learned that in order to call the sub from the main program it must be located in "C:\Mach3\Subroutines\" and then the file name.
I learned that in the main program when you use M98 the file name must have brackets around it.
The sub must end in M99.
Please correct me if I am wrong on any of the above.
What i want to do is to move to a X and Y location and then run the subroutine or my file. Now my file has a starting point of X0 and Y0 and all the cuts in the sub are referenced from this starting point and finish at the starting point. When the sub is finished and passed back to the main program the DROs should read the X and Y locations that were there before the subroutine was run.
Am I trying to do the impossible?
Thanks to all
Ray
Logged
HimyKabibble
V4 Screen Contributor
Offline
Posts: 1,347
Re: Locating question
«
Reply #7 on:
January 17, 2011, 12:30:28 AM »
Dan has answered your question. Where his example has "(your code to cut rectangle here", simply call your subroutine.
Regards,
Ray L.
Logged
Regards,
Ray L.
rdean
Active Member
Offline
Posts: 23
Re: Locating question
«
Reply #8 on:
January 18, 2011, 07:37:10 AM »
I have taken your advise and started back at the beginning with the code from Dan. This is what I am working with.
G1 X1
G1 Y1
G1 X0
G1 Y0
G0 X-3 Y0
G52 X-3 (this will offset the current point by -3 making it X0. Y remains the same)
G1 X1
G1 Y1
G1 X0
G1 Y0
G52 X0 (set the offset back to zero)
G0 X3 Y0
When I load this code the display window shows two squares on the X axis three inches apart which is what I would expect to see.
When I run the program the crosshairs start at the left lower point of the right square and procedes to cut around until it gets back to 0,0. The propgram then sends the crosshairs to X-3 which is the starting place for the left square. Instead of showing the cut around the left square the crosshairs jump to the right square and retraces the path there. When it is done there the crosshsairs jump to 0,0 of the left square and them moves to X3. Why is it not showing the cut around the left square even though I beleive if I had the motors hooked up it would actually be cutting the left square?
If I step through the program the display will show show all the cuts on both squares but not when I run the program. Do I have something set wrong in the setup or display configuration screens?
I beleive this has been my problem all along as I have relied on the display screen to show me what I would be making. Even after I had checked my code many times the display would not show what i thought thould be there.
Thank you for any help
Ray
Logged
Dan13
Active Member
Offline
Posts: 759
Re: Locating question
«
Reply #9 on:
January 18, 2011, 09:10:25 AM »
Hi Ray,
It is a display error in Mach. The actual movement will be correct though.
Dan
Logged
Pages:
1
2
»
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.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****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
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...