585,883 active members*
4,764 visitors online*
Register for free
Login
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2011
    Posts
    0

    Macro/Variable Programing

    Is there a way to set up variables in wincnc. I tired the following program that would work on the HAAS machine that I am used to working on.

    (ARCH DOOR CUTOUT MACRO)
    #101=3 (DOOR WIDTH)
    #102=5 (DOOR HEIGHT)
    #103=3 (DOOR ARCH RADIUS)

    (STARTS AT BOTTOM LEFT OF DOOR AT (0,0), Z=0 SHOULD BE TOP SURFACE OF MATERIAL TO BE CUT)
    N01 G90
    N05 G00 X0 Y0 (MOVES TOOL TO (0,0) POSITION RAPIDLY)
    N10 G00 Z.1 (MOVES TOOL .1" ABOVE BOARD)
    N15 G01 Z-.05 F100 (MOVES TOOL .05" INTO BOARD AT A FEED RATE OF 100 IN/MIN)
    N20 X#101 (MOVES TOOL IN THE POSITIVE X DIRECTION THE AMOUNT OF THE WIDTH VARIABLE)
    N25 Y#102 (MOVES TOOL IN THE POSITIVE Y DIRECTION THE AMOUNT OF THE HEIGHT VARIABLE)
    N30 G03 X0 Y#102 R#103 (MOVES THE TOOL IN A C'CW ARCH AT THE ARCH RADIUS)
    N35 G01 Y0 (MOVES TOOL TO STARTING POSITION)
    N40 G00 Z1 (MOVES TOOL OUT OF BOARD)

    The local high school just purchased a shopsabre with the wincnc software and I have been trying to help get them started. I am by no means a G code expert just know some of the basics. For what they are doing macro programing or variable programing would be ideal for most of their items, but it does not seem to work correctly and I have yet to find any good instructions online. Thanks in advance for any help.

  2. #2
    Join Date
    Nov 2010
    Posts
    85
    Chadr03,

    Wincnc doesn't use variables for it's code. It does allow XYR for arcs, but I would suggest you use incremental IJ for arcs. It's tried and true.

    My opinion..., the school needs to buy CAD/CAM software. Shop Sabre sells a very good package by Vectric. They have different levels that can do everything from basic 2D all the way to 3D and rotary axes cutting.

    Did they buy the machine new? Does it have a tool changer, a dust collector, or a vacuum table? If so, there will be macros that control these options. Most have special macros set up in the software that are called by using M Codes.

    Don't change the files, but you can look at the 'cnc.mac' and the 'wincnc.ini' files with notepad and get some idea of what is going on. Repeat..., don't change the files! The 'cnc.mac' file will have the M Codes defined - something like 'M3=M98 spin.mac' and another like 'M5=M98 spinoff.mac'.

    In our made-up case here, you would find a file called 'spin.mac' in the Wincnc folder. Inside that file you'd find something like 'M11C2', this means turn on channel 2. Then maybe the next line says 'G4X4', this means pause 4 seconds so the spindle can get up to speed.

    You'd also find a file called 'spinoff.mac'. Inside the file you'd find a line like 'M12C2', meaning turn off channel 2.

    Remember, this is only shown as example. Your files will not be exactly like this.

    If the machine is new I'm sure Shop Sabre would give you some free training. If used, I'm sure they would help you for a small fee.

    As for your code, shorten your comments so that the line has less than 80 characters per line, plug in the numbers from your variables, and it should run. You'll have to manually turn on everything like the spindle and the vacuum, but the code should run.

    Good luck,

    Butterknife

Similar Threads

  1. Macro programing or subroutine
    By stucaruk in forum Fadal
    Replies: 17
    Last Post: 10-03-2010, 02:17 AM
  2. Variable programing help
    By matyh100 in forum G-Code Programing
    Replies: 2
    Last Post: 07-21-2010, 08:02 AM
  3. Macro Variable Lock
    By James L in forum Haas Mills
    Replies: 2
    Last Post: 07-23-2009, 02:29 PM
  4. macro programing
    By ikneb in forum Fanuc
    Replies: 10
    Last Post: 10-03-2008, 01:52 AM
  5. macro programing
    By 9axis in forum G-Code Programing
    Replies: 2
    Last Post: 03-19-2008, 11:52 AM

Tags for this Thread

Posting Permissions

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