CNC Feeds & Speeds Course

 

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

Subscribe

Join 50,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

Categories

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
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website
Show us your humanity*

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.