Categories

 

G-Wizard Calculator:
Fast, Easy, Reliable Feeds and Speeds

Subscribe

Join 100,000+ CNC'ers!  Get our latest blog posts delivered straight to your email inbox once a week for free. Plus, we’ll give you access to some great CNC reference materials including:

  • Our Big List of over 200 CNC Tips and Techniques
  • Our Free GCode Programming Basics Course
  • And more!

 

GCode is Complicated
G-Wizard Makes it Easy

How to change Y value in a subroutine?

Answered
0
0

I am trying to write a subroutine that has all the codes neccessary for a specific variable that I want. So if in the main program I want the Y value to be 29 how would I insert a subroutine so that when I insert 29 it will automatically change to 29 for the Y value in the subroutine ?

  • You must to post comments
Best Answer
0
0

Henry, if I understand your question, there are a couple of ways.  One would be to simply have “29” be in the Y before calling the subroutine.  The other answers depend on your controller.  With a Fanuc, you can pass in the Y on the same line and it comes out in a #variable that can be accessed.  You could also assign the Y value to a particular #variable and then reassign back to Y in the subroutine.

For more on subroutines and #variables, check out our free G-Code Tutorial:

http://www.cnccookbook.com/CCCNCGCodeCourse.htm

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

 

Do you want to be a better CNC'er?

Get Better Tool Life, Surface Finish, and Material Removal Rates.

 

Start Now, It's Free!

Home

Software

  GW Calculator

  GW Editor

  Gearotic

  Conversational

  Deals and Steals

CNC Blog

  Software

  Techniques

  Beginner

  Cool

  Projects

 

Cookbooks

     Feeds and Speeds

     G-Code Tutorial

     CNC Machining & Manufacturing

     DIY CNC Cookbook

     CNC Dictionary

CNC Projects

Resources

     Machinist's Search

     Videos

     Online Groups

     Individuals

     Reference Data

     Books

     CNC Dictionary

     Suppliers

     Tool Brands

Workshop

     Hall of Fame

     Organization: Soon!

 

About

     Customers

     Partners

     Our History

     Privacy Policy

 
All material © 2016, CNCCookbook, Inc.