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:

Can someone please walk me through this snippet of code!?


Recommended Posts

Whilst on the mastercam forum I got some help for an issue I'm trying to resolve. The help I got was a snippet of code I couldn't decipher what was going on, and no explanation of such. I'm still in the very early stages of learning/teaching myself how to manipulate and write code for MP. Without the help of this forum and mastercam's forum I would be out to lunch. I bring this problem here because it seems to be geared a little more towards the user trying to learn the language to some degree. I'm trying to capture my sub spindle's axis values and I failed using the legacy method and was told the new info method was the way to get it done. The snippet I'm posting is exactly how it was presented to me as 'an example'. If someone could please walk me through this code and what it is doing I would be extraordinarily grateful. Thanks.

 

1202583216_whatisthis.thumb.jpg.bb4fd7b2a5f35eed0b8a0d5e52272776.jpg

 

 

 

 

 

 

 

Link to comment
Share on other sites

This is for a Doosan Mill/Turn. This particular piece of code is actually some example code a guy from CNC Software gave me to try and help me. Problem being I haven't had any experience with the 'stream' function, and other parts of this post. I'm still learning MP.  I'm trying to capture a sub spindle axis origin so that I can use it in some logic in other places of the post.

Link to comment
Share on other sites
54 minutes ago, M.Bluedorn said:

This is for a Doosan Mill/Turn. This particular piece of code is actually some example code a guy from CNC Software gave me to try and help me. Problem being I haven't had any experience with the 'stream' function, and other parts of this post. I'm still learning MP.  I'm trying to capture a sub spindle axis origin so that I can use it in some logic in other places of the post.

Well the MP is going through a transformation process and along of what I learned 20+ years ago is being put out to Pasture. If your not keeping with the latest scripting languages then going to be hard to see and understand the differences. 

You were given a good method and I can loosely follow it, but there are variables that make sense, but I haven't seen used in a MP post before. 

Link to comment
Share on other sites

I replied back to the guy who gave me that code to hopefully help me understand how it is working. I'm already 'behind the eight ball' so to speak with my inexperience with the language, and to hear that it's going through some major changes is  a little disheartening to hear given I've worked very hard to teach myself and learn what I have so far about the MP language.

Link to comment
Share on other sites
12 minutes ago, M.Bluedorn said:

I replied back to the guy who gave me that code to hopefully help me understand how it is working. I'm already 'behind the eight ball' so to speak with my inexperience with the language, and to hear that it's going through some major changes is  a little disheartening to hear given I've worked very hard to teach myself and learn what I have so far about the MP language.

MP.net comes along we all get kicked to the curb of seeing and modifying anything in a post was what I heard a decade ago. It is used in the Mill/Turn environment and locked down tighter that Fort Knox. Moduleworks is another example unless you're a 3rd Party Post developer giving them their royalties every time you sell a Simulation environment you don't have access to what is needed to make it work either. I remember enough now a days to fumble my way through it, but been years since I have to do anything serious with it. 

Link to comment
Share on other sites
On 9/28/2020 at 8:34 AM, M.Bluedorn said:

This is for a Doosan Mill/Turn. This particular piece of code is actually some example code a guy from CNC Software gave me to try and help me. Problem being I haven't had any experience with the 'stream' function, and other parts of this post. I'm still learning MP.  I'm trying to capture a sub spindle axis origin so that I can use it in some logic in other places of the post.

Are you using Mastercam Mill/turn software or Mastercam Lathe software for programming your mill/turn?

Link to comment
Share on other sites
On 9/28/2020 at 10:13 AM, M.Bluedorn said:

I've read a little about MP.net but can you go into more detail about it? What exactly is it?

The MP Post Language is the original "scripting language", used to process NCI data. I think you've figured out this much by now.

MP takes NCI data, and formats it into NC Code output. There is a separate "layer" in-between the NCI and the Post, called Machine Definition and Control Definition, which allow options to be configured for output. But these are essentially "switches" that you set in parameter pages, and that's it. Any "manipulation" is done at the Post level, with input data from the Operations, Tools, Machine Definition, and Control Definition settings.

With MP.Net, there is now a separate "Simulation Layer" that exists as a Software Layer between Mastercam and the NC Code output.

This Simulation Layer is called "Mastercam Extensions". It allows you to bring in Operations, and perform Simulation, Operation Synchronization, and setting of Coolant and Wait Codes.

There is bi-directional linking between the "Mastercam Ops", and the "Simulation Ops", to some extent. That allows you to regenerate operations, and have your Tokens stick.

Instead of using "Misc. Values" (integers or real numbers), to control output settings, you end up setting Token values in the Extensions (simulation) Layer. A Token is a variable with properties.

As a user, you have access to set some "token default values", but most of the tokens should be created for you when you get a .Machine file. (Dot Machine File)

I believe that eventually all the Posts will be created in MP.NET, but we're probably at least a decade away from that happening. I bet "Standard MP", will likely be around for another 20+ years. The real question is: at what point will Mastercam (CNC Software), force the switch over to MP.NET? Again, my guess is over a decade, but who knows?

The regular MP Language is very powerful, and you can do everything that MP.NET would do, with the exception of integrating into a "Simulation Layer".

Technically, you can drive Mastercam Simulation through a MP-Based Post, but that is a not the same thing as what MP.NET provides.

 

 

  • Like 1
Link to comment
Share on other sites

 

On 10/3/2020 at 2:07 AM, Tim Johnson said:

Are you using Mastercam Mill/turn software or Mastercam Lathe software for programming your mill/turn?

I'm using the Mill/Turn software.

10 hours ago, Colin Gilchrist said:

The MP Post Language is the original "scripting language", used to process NCI data. I think you've figured out this much by now.

MP takes NCI data, and formats it into NC Code output. There is a separate "layer" in-between the NCI and the Post, called Machine Definition and Control Definition, which allow options to be configured for output. But these are essentially "switches" that you set in parameter pages, and that's it. Any "manipulation" is done at the Post level, with input data from the Operations, Tools, Machine Definition, and Control Definition settings.

With MP.Net, there is now a separate "Simulation Layer" that exists as a Software Layer between Mastercam and the NC Code output.

This Simulation Layer is called "Mastercam Extensions". It allows you to bring in Operations, and perform Simulation, Operation Synchronization, and setting of Coolant and Wait Codes.

There is bi-directional linking between the "Mastercam Ops", and the "Simulation Ops", to some extent. That allows you to regenerate operations, and have your Tokens stick.

Instead of using "Misc. Values" (integers or real numbers), to control output settings, you end up setting Token values in the Extensions (simulation) Layer. A Token is a variable with properties.

As a user, you have access to set some "token default values", but most of the tokens should be created for you when you get a .Machine file. (Dot Machine File)

I believe that eventually all the Posts will be created in MP.NET, but we're probably at least a decade away from that happening. I bet "Standard MP", will likely be around for another 20+ years. The real question is: at what point will Mastercam (CNC Software), force the switch over to MP.NET? Again, my guess is over a decade, but who knows?

The regular MP Language is very powerful, and you can do everything that MP.NET would do, with the exception of integrating into a "Simulation Layer".

Technically, you can drive Mastercam Simulation through a MP-Based Post, but that is a not the same thing as what MP.NET provides.

 

 

Thanks a ton Colin! That's all I was really wondering. I kept seeing mention of it, and just wasn't sure what was being discussed. I really appreciate you taking the time to explain it for me!

Link to comment
Share on other sites
1 hour ago, M.Bluedorn said:

 

I'm using the Mill/Turn software.

Thanks a ton Colin! That's all I was really wondering. I kept seeing mention of it, and just wasn't sure what was being discussed. I really appreciate you taking the time to explain it for me!

I'm happy to help. I owe a lot of my success to the education and relationships I've built from this forum, so I enjoy giving back where I can.

If you are looking to learn more about Post Processor Editing, I just uploaded the videos for one of my MP Post Processor classes to YouTube. If you search "MP 101", it should pop up for you. I need to go edit the videos to include more keywords for to make them easier to find.

  • Like 1
Link to comment
Share on other sites
1 hour ago, Colin Gilchrist said:

I'm happy to help. I owe a lot of my success to the education and relationships I've built from this forum, so I enjoy giving back where I can.

If you are looking to learn more about Post Processor Editing, I just uploaded the videos for one of my MP Post Processor classes to YouTube. If you search "MP 101", it should pop up for you. I need to go edit the videos to include more keywords for to make them easier to find.

Awesome!!! Thanks again!

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...