588,385 active members*
5,453 visitors online*
Register for free
Login
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    636

    Please verify my code

    I am taking a cnc programming class at our local community college and we are working with subroutinges this week. What we are programming is a simple grid of drilled holes (10 holes x 10 holes) in a staggered location.

    I am using NC Plat to try to verify the program, but it does not show what I figured it would. I checked the program and do not find anything wrong so I am thinking it does not recignize some of the code.

    Can someone check this over for me? Can anyone recommend a software that will properly display this program correctly?

    This is for a HAAS Mill.

    Thanks

    Dan
    Attached Files Attached Files
    Check out what I am working on at www.routerbitz.com!

  2. #2
    Join Date
    Mar 2003
    Posts
    4826
    I think your M98 call should refer to the program number of the subprogram, and I don't see that in your code. But, I never have run a subprogram on Haas, I've always used M97 local subroutines.

    Apart from that, your code should run I believe. It could be the case that the way you have set up your code lacks enough gcodes for NCPlot to interpret it correctly when it returns from the sub. For example, although you switched back to absolute mode within the subprogram, NCPlot may or may not be able to interpret the axis moves in the main program correctly. You could add a G00 G90 in front of each move in the main to help NCPlot switch modes correctly.
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Mar 2004
    Posts
    636

    Yes and no

    Thank you for looking.

    Yes you are correct that I did not correctly call out the name of the subroutine. Copy and paste error on my part. Unfortunately it did not fix the problem.

    Any other ideas? I am posting the updated program.

    %
    O1413 (EX 14.1 BY DAN REEDY)

    (PECK DRILL .25" DIAM HOLE 1/4" DEEP)

    T01 M06
    S1800 MO3
    G00 G90 G54 X.5 Y.5
    M08
    G43 H01 Z.1
    G83 Z-.25 Q.05 R.1 F8.0
    M98 P1414 L4
    X1.0 Y1.0
    M98 P1414 L4
    X.5 Y1.5
    M98 P1414 L4
    X1.0 Y2.0
    M98 P1414 L4
    X.5 Y2.5
    M98 P1414 L4
    X1.0 Y3.0
    M98 P1414 L4
    X.5 Y3.5
    M98 P1414 L4
    X1.0 Y4.0
    M98 P1414 L4
    X.5 Y4.5
    M98 P1414 L4
    X1.0 Y5.0
    M98 P1414 L4
    G80
    G00 G91 G28 Z0 M05
    G28 Y0 M09
    G90
    M30
    %



    %
    O1414
    (SUBPROGRAM 1 - CHANGE LOCATION OF .25" HOLES)
    G91 X1.0
    G90
    M99
    %
    Check out what I am working on at www.routerbitz.com!

  4. #4
    Join Date
    Mar 2003
    Posts
    765
    What happens when you try to run it in NCPlot? Does it give you an error, or does it just not plot correctly?

    Scott

  5. #5
    Join Date
    Mar 2004
    Posts
    636

    No error

    It doesn't give me an error, just does not plot correctly. It will plot the first hole for every line. It plots the hole location in the main program but does not seem to go to the sub program at all.

    Thank you

    Dan
    Check out what I am working on at www.routerbitz.com!

  6. #6
    Join Date
    Jul 2005
    Posts
    12177
    Quote Originally Posted by Hack View Post
    ....Can someone check this over for me? Can anyone recommend a software that will properly display this program correctly?

    This is for a HAAS Mill.

    Thanks

    Dan
    Okay, because you asked nicely . It runs perfectly well on my Haas Simulator.

    Does your college not have Haas Simulators? They are dirt cheap at less than $1700 (I think) for one that simulates Mill or Lathe.

    I have tried running programs with subroutines through NC Plot and never had success.

    Being a bit picky I will point out you are working with a subprogram not a subroutine. As Hu points out the call is different M97 for a subroutine included with the running program and M98 for the external call. Possibly your instructor is not as precise as could be and does not make distinction between the two.

    And here is a challenge for you. Your program has thirty or so lines and multiple repeating lines, the subprogram calls. I think you should be able to shorten it by writing a program using nested subroutines and reduce your line count. Maybe not an issue with a ten by ten array but if you wanted to do a hundred by a hundred the nesting helps.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  7. #7
    Join Date
    Mar 2003
    Posts
    765
    This is what I get when I run it in NCPlot. Just make sure you don't have it set to ignore M98 subprograms (see screenshot). This is under the menu "Setup". There is also a setting on the machine configuration, under the G/M Code page that sets how the M98 command is recognized. Make sure it is set to the first option, "M98 P1 L1".

    Thanks,
    Scott
    Attached Thumbnails Attached Thumbnails screen.jpg  

Similar Threads

  1. Edit/Modify MC Post, Then Verify???
    By Dugg in forum Mastercam
    Replies: 8
    Last Post: 12-30-2006, 02:16 PM
  2. HELP! Rotating an STL file generated in verify
    By AMCTony in forum Mastercam
    Replies: 7
    Last Post: 07-24-2006, 02:25 PM
  3. Please verify my Driver Wires
    By electron in forum Stepper Motors / Drives
    Replies: 1
    Last Post: 02-23-2006, 04:54 AM
  4. 4 axis verify utility?
    By DAB_Design in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 6
    Last Post: 04-27-2005, 06:38 AM
  5. Gcode verify autocad plugin
    By balsaman in forum Uncategorised CAM Discussion
    Replies: 1
    Last Post: 10-31-2003, 06:22 PM

Posting Permissions

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