Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Sub Routines with a Haas Control


jenks
 Share

Recommended Posts

I need to make my programs smaller, so I have tried the subroutine route when posting out my programs. I have encountered some problems.

 

[1] When I post the program, it looks just exactly like the subroutine programs shown in the Haas instruction manuals.

 

[2] When I load the program on the control, it puts all of the subroutine programs on the directory page as separate programs. Has anyone ever tried to give the subroutines a number other than a "Onnn" number?

 

[3] Then when we try to run them we get all kinds of faults.

The odd thing is that it may run through several subroutines before it faults on one. The faults are listed by the control, and they don't even apply to the subroutine at all. One in particular was giving I,J, & K errors, but there were no arcs in the subroutine.

 

[4] I know subroutines work because I have written them manually for the machine, although they were not near as complicated as what I am trying to do with Mastercam.

 

I'm sorry, but I can't load the file to Forum, since my employer has taken away all Internet connections.

Link to comment
Share on other sites

I am afraid that without seeing sample code, it is pretty hard to figure out where the problem lies.

 

Subprograms obviously need a different Oxxxx than the main program, but they can be loaded either separately under different numbers or as one large program containing main and subs. This is not the most efficient way, since your M99 code will return the program to the last M98 sub call which isn't always where you want to go.

 

If you can post some code in the future, I am sure folks here can help out.

 

Peter Eigler

Link to comment
Share on other sites

When people say sub routine I think of a call internal to the program like a line number call or a goto statment or even lable call for the Heidenhain folk. I would call what you are describing as a sub program.

 

Anyway, my understanding of the sub program call leaves the main program from the M98 P**** where **** is the program # minus the O word, the code is ran from that point in the subprogram untill it reaches another M98 to a "nested sub" or a M99 to return tho the line directly after the M98 call that got it to the sub in the first place. The controller will take care of knowing from where the call to the sub came from so there is no danger of returning to some other point in the program.

 

I'd run it by the Hass tech's see what they say.

 

HTH

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...