585,974 active members*
4,338 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > Ever wished you could use real names instead of numbers for #variables?
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2005
    Posts
    2502

    Ever wished you could use real names instead of numbers for #variables?

    Macro programming is hard enough, but I always found remembering what #107 actually did in my subprogram was torture. I'd keep a cheat sheet handy, but it was still painful.

    Some controls fix this. LinuxCNC lets you say, "#<holedia>" instead of #107, for example. Fanuc has a syntax called "SETVN" on some controls, but not all. Okuma and others have symbolic names.

    I just added a feature to G-Wizard Editor that lets you work with symbolic names whether your control supports them or not. It's described in a blog post here:

    G-Wizard Editor v0.680 is out: Try the new SETVN support even for controls without SETVN « CNCCookbook CNC Blog CNCCookbook CNC Blog

    Basically, it saves Fanuc-compatible "SETVN" statements in a comment. Now here is the nifty part:

    You don't have to even have a Fanuc control to use it. You could be on Mach3, for example. What it does is when you load the file, you can execute a command that will read all those comments, search and replace all the #107's to be #HOLEDIA, and the GWE simulator will understand and execute those properly.

    Then, when you're done editing and simulating, run the command again, and it converts them back to numbers. But, the definitions for those numbers are saved in comments that will be there the next time you want to use and understand the program.

    Check it out. Our Beta testers really like the feature. Registration for the Beta test is free:

    GWizard Editor: A G-Code Editor and Simulator

    Cheers,

    BW

    Cheers,

    BW
    Try G-Wizard Machinist's Calculator for free:
    http://www.cnccookbook.com/CCGWizard.html

  2. #2
    Join Date
    May 2004
    Posts
    4519
    I just always add comments to my variables and macros including what each line is supposed to do. Makes for easier editing later.

  3. #3
    Join Date
    Feb 2006
    Posts
    1792
    Numbers have their own advantages. You can do arithmetic operations on them, if needed. This technique is often used with system variables.
    Your software, however, would be useful for local/common variables.

  4. #4
    Join Date
    May 2005
    Posts
    2502
    sinha, no reason you can't do arithmetic here too. The variables have both a name and a number with the Fanuc SETVN and the syntax I've described for GW Editor.

    Cheers,

    BW
    Try G-Wizard Machinist's Calculator for free:
    http://www.cnccookbook.com/CCGWizard.html

Similar Threads

  1. File names
    By Technical Ted in forum Mastercam
    Replies: 4
    Last Post: 02-13-2012, 04:14 AM
  2. want to cut names from 1" MDF
    By Partypico in forum Metalworking- / Woodworking Tooling / Manual Machining
    Replies: 0
    Last Post: 02-10-2010, 01:29 PM
  3. Anyone ever bought an X2 and wished they'd bought an X3?
    By isaac338 in forum Benchtop Machines
    Replies: 17
    Last Post: 04-15-2008, 04:06 AM
  4. Names
    By ErnieD in forum Trade Shows / Webinars / Other Events
    Replies: 0
    Last Post: 03-20-2007, 10:48 PM
  5. Real, real newbie!!!
    By aggie_67 in forum Uncategorised CAM Discussion
    Replies: 11
    Last Post: 02-04-2006, 07:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •