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:

MP Language Components


Recommended Posts

I have been reading the V9 Post reference guide and I understand what files files make up a post processor and in general how a post is organized, however when the reference guide starts to talk about the components of the MP language I'm lost. For instance when it talks about variables to produce NC output the example given is: n, scoolant, next_tool, e. What if any NC output would that produce, or what does that represent. Also in general how can I make sense of the MP language. Do I need more of a background in computer programing to understand the MP language.

 

Thanks,

 

Justin

Link to comment
Share on other sites

quote:

For instance when it talks about variables to produce NC output the example given is: n, scoolant, next_tool, e.

Well depending on condition of the variable at the call point the output could be different.

 

n = will give you an N#

scoolant = if coolant is on you'll get an M9, if it is off you'll get an M8

next_tool, when post processing, if there is a next_tool call, it's value is stored and if using pre-staged tooling you'll get the next tool called T#

 

To do more than the most rudimentary of editing some basic understanding of computer language is a good thing to have. The nice thing about MP is you do not need a degree in computer science to be able to use it. An understanding of how to construct calls is a pretty good start.

 

You might try and find a MS Basic book and glance it over, it's not the same as MP but the structure can be built on.

Link to comment
Share on other sites

quote:

Do I need more of a background in computer programing to understand the MP language.


Not really, but a bucket full of common sense will go a long way.

 

I've done some very minor post mods (with the help and guidance of some very talented forum members), and from what I've seen just by reading the post files and knowing the desired output of code, it's not all that complicated. Granted, some effects are more difficult to achieve than others, but overall, it's pretty logical.

 

From my limited experience, "n" is a variable which relates to the line or block numbers in the G code, N100, N200, for example. "scoolant" obviously stores info about coolant requirements M08, M09. If I had to guess, "next_tool" would store info on whether a toolchange was required and output the proper toolchange sequence as defined by the .NCI file. All I know about "e" is a lot of times it requires a "$" after it in the post file to get the proper output and placement of the desired code. smile.gif

 

 

Now that I've raised more questions than I've answered, I'm sure someone will be along to set us both straight.

 

HTH

Link to comment
Share on other sites

Justin,

 

The MP Post language is based on "Standard C" programming, with a few changes.

 

As you are reading through the language there are several things to be aware of.

 

In the example you gave above there are four blocks of code. Each block can be thought of as an "arguement" that will produce code output, set a variable, call another post function (called a post block), or perform some other action.

 

The line would normally be used on a machine tool that pre-stages the next tool for faster tool changes.

 

As John and Ocean mentioned, the (n,) block would output a sequence number to the NC file. Then the "scoolant" variable would output a coolant command depending on the value of the scoolant variable.

 

For version X CNC Software made some modifications to the formatting of pre-defined variables. Pre-defined variables now end with a dollar sign ($). So technically this line should be:

 

n$, scoolant$, next_tool$, e$

 

The e$ is the "End of block" variable which tells the Post to end the current line of NC output and start assembling a new line.

 

The MP language also contains boolean logic. I'll give you a quick example:

 

if mi1$ = 3, pretract

else, pretractinc

 

For an "IF" statement, the post is checking to see if a condition has been met.

 

You can read the first line above like this:

 

IF "condition is true" THEN do something.

 

the THEN is represented by the comma. So in english what that line is doing is checking to see if the value of (mi1$) miscellanous integer # 1 is positive ("true" in boolean logic), THEN call the pretract post block.

 

The second line is an "Else" branch. So if the condition of the mi1$ variable is "False" (a value of zero), the Post will call the pretractinc post block instead.

 

One of the things that will help you in the long run would be to download the latest copy of the MPMaster post. I base every single new post I'm modifing on the MPMaster post because there is a huge amount of logic that was built into it by the guys at In-House solutions. Most of the time when you want to change something all you need to do is make a simple change to one of the variable switches and you are done. It is much easier than writing a custom post block.

 

HTH,

Link to comment
Share on other sites

If you have any questions about the MP post language, posting the question here on the forum is a likely to get you the answer pretty quickly.

 

scoolant is not a predefined variable, so scoolant should not have a $ sign in a X post, but the other three should, so in a X post, that line should be n$, scoolant, next_tool$, e$

 

The output created by that line depends on a number of circumstances. The other posts above outline the maximum output, a block which could for example be "N112 M8 T21", but under certain circumstances (coolant off and defined modal, pre-staging of tools off or only one tool in the program) that line would not produce any output at all.

Link to comment
Share on other sites

Justin,

 

Christian is right about no output occuring if scoolant finds no coolant "on" and "stage tools" is turned off. Part of the reason that no output would occur is that the n$ variable requires other code output to occur for it to be active. Same goes for the end of line variable e$. If there is no other code to be output on that line, both n$ and e$ would not output either because they require some other code to be present on the output line. This logic is built into the post DLL itself.

 

I hope that I didn't make that too confusing. Sometimes you will see a variable with a grave symbol (`) in front of the variable name. The grave symbol also will make a variable active only if there is another block of code being output on the same line. If no other code is present, the post will not output the variable with the grave symbol.

 

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