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 program call for every z depth


Recommended Posts

Hahahaha

You missed the $$$$$$ apparently.  Colin could certainly do it but that's gonna get into some time which is a commodity.  You could do it yourself if you take a few post editing classes.  I know a guy who offers those too, his name is Colin and he is one of the best there is.

  • Like 1
Link to comment
Share on other sites

No. I'm not going to tell you where to go edit the Post to do this, because as I mentioned in my original post in this thread: this is not a trivial task.

For someone who really knows the MP Language well (like I do), I would estimate about 8-10 hours of work to figure this out. Here are roughly the steps involved.

  1. Create variables are write logic to detect "if subprogram switch is enabled" in the operation dialog.
  2. Create "flag" variable to indicate that you are in "subprogram" mode.
  3. If "subprogram mode" is active, calculate the number of depth passes (rough and finish). This may not be trivial. Calculate "total depth" based on absolute vs. incremental values for Top of Stock and Depth.
  4. Subtract any "finish passes" from "total depth". Now, divide "total depth" by "max rough step". If there is a remainder, use the "integer portion" of the result (total depth  /  max step), and add "1" to the result. (increase the total number of "depth cuts", as the "max step" value is just a "maximum", and that is how Mastercam will handle this internally.) So no you have your "total number of rough depth cuts", and you know the actual "rough step Z value" (which may be "less than" your Max Depth).
  5. If you are seriously going to attempt this, I would actually recommend that you "Don't Finish" with the Operation that has the Supprogrammed Depth Cuts, as it will just make your Post Development harder...
  6. So, you've calculated the number of passes, and detected that "depth cuts" and "subprograms" are on. You've calculated some depth passes.
  7. Now, you've got to edit the "subroutine" output section of the Post. You want to make sure that the Subprogram itself is written "only once". The existing logic should take care of that for you. (the actual writing of the Subroutine, and placing it "before/after" the main program. You need to locate the Subroutine section that writes to the "main" program, and modify it to do this: "Output the 1st Subroutine call (M98 or G65, whatever), with the "L" Loop repetition call. You've calculated the output, so this is the easy part.
  8. Next, you have to use the "flag" that you setup, along with possibly using 'op_id$' or by tracking the actual Operation Number (15240) parameter, so you can tell "if you are still processing the "same operation". If you are still "in the same OP", you can use the "ex$" function in MP to exit the current output line, and return to the NCI stream for more processing.
  9. The trick will be "Turning the output back on", at the correct spot.

 

What you would need to do is "output the Subroutine call, with the Loop repetition", but then you would have to "suppress normal NCI output" to the NC File, and then start it again, after all the "Depth cuts" from the current operation are processed.

So, what I'm really trying to say here, in a polite way, is you need a professional. Unless you've written quite a few Post Processors, and had some real training, then I'm afraid a task of this magnitude is beyond the scope of your abilities.

  • Thanks 1
Link to comment
Share on other sites

The heart of the issue is the "Way that MP Processes NCI Data". The Post is designed to read the NCI File, from start to finish, and output the data to the NC File, that your PST File "tells it to output". Sometimes, this is really easy. What you are asking for; suppressing the normal output stream, but only for a single operation, sounds like it should be easy to do. The truth is that there are lots of tasks that are easy to accomplish with relatively minor edits. Generally, anything dealing with "Subprograms", in almost any capacity, is not going to be easy...

  • Thanks 1
  • Like 1
Link to comment
Share on other sites
11 hours ago, Mathana Gopal said:

please suggest me where to edit to get the desired output. 

I don't think you understand the function of the forum. A quick look at your activity shows nothing but wanting things, including being "kicked back" for requesting a post.

If you want something from people here you have to show some willingness to contribute, it is not a free service request website.

The forum is a mutual support group, so you will need to contribute something. I doesn't need to be about your current problem but some sort of contribution is generally greeted warmly, especially when you post in the Post Processer Development Forum, free loaders are generally given pretty short shrift (as you found out with your Post Processer request).

As most of your requests seem to be for post processer modifications, I would recommend the following:

Contact your reseller and request the relevant documentation (MP language docs)

Study documentation,  take a course on post modification or preferably both (for your sake).

Make some sort of effort to solve your problems with the above information.

Learn to use the debugger

Post a question that shows that you have made some sort of effort yourself rather than just requests for someone else to do all the work for you (and apparently you prefer all this work to be done for free).

If you cannot do the above ask your reseller and he will provide you with a quote (that is how much they will charge you) for the work you require.

  • Thanks 2
  • Like 2
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...