CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > CAM Software > Mastercam > Post Processors for MC



This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 05-07-2006, 05:27 PM
 
Join Date: Apr 2006
Location: United States
Posts: 33
skyline is on a distinguished road
Learning to write MC Posts

Hello everyone, I was wondering what is the best approach in learning how to write MC posts. What language does it use and where can I find information regarding the conventions of this programming language? Thanks. Also where can I find information on rewriting generic posts to be machine specific..
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 05-07-2006, 07:02 PM
Alex_Cole's Avatar  
Join Date: Mar 2005
Location: usa
Posts: 189
Alex_Cole is on a distinguished road

Mastercam's post processors are not really any specific programming language. It's kind of there own language where they have some of there own functions.

A mastercam post processor is just a config file if you will. There is a c file called mp.dll that does all the processing. When you post a program in Mastercam the mp.dll file uses the .pst(post) file to format the lines of data that come from the NCI file. The NCI data file is read 2 lines at a time until the entire file has been processed. There is a PDF reference guide available from your local Mastercam dealer. Call them and ask them if they could send you a copy. Some distributors might charge for it, but now it is electronic instead of printed I am not sure if they still are or not.

The post reference guide explains how post processing works and what files are involved. It also has reference to available functions, and variable lists. If you do not have experience with programming it might take you a little bit to catch on, but you can get it figured out. If you do have programming background then it will probly be much easier for you to get up and writing posts.

There are posting classes available from CNC software in CT that you could take. They cover a good base of posting and how to get started. I think they have a class sometime in may but it might be too late to get signed up for it. Once again your local Mastercam dealer should be able to help you out with getting this information.

One thing I want to point out is Mastercam X posts are a little different than previous versions and are not covered in the general post reference guide yet. You can reference the Mastercam X parameter reference that gets installed in the documentation with the Mastercam X software. They have changed some things with the new version. One of the 1st things you will see is the "$" that is now at then end of all pre-defined variables and post blocks. They have also change some things about selector tables adding two digets to the fstrsel(format string select) line. The major logic methods have all stayed the same, but there are new thing to get to like the Machine def and control def parameters.

If you have questions about things feel free to ask...just send an email to alex_melissa at sbcglobal.net (replace at with @ and no spaces) I will try to help you in as timely mannor as possible.

Hope this helps

alex
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 05-08-2006, 05:57 PM
 
Join Date: Apr 2006
Location: United States
Posts: 33
skyline is on a distinguished road

So there's really no good literature on this topic other than the reference guide? I saw some information in the MCAM9 Getting started book but it was very vague and gave no clues as to the modification of the post. I'll send my reseller an email and see what response I can get. Thanks
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 05-08-2006, 09:35 PM
 
Join Date: Apr 2006
Location: United States
Posts: 33
skyline is on a distinguished road

Also forgive my ignorance but does the machine defs and control defs effect the way the code is generated? So in effect if this is true you can effect the way the post, post out code by changing the variables in the control/machine defs.
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 05-09-2006, 08:13 AM
Alex_Cole's Avatar  
Join Date: Mar 2005
Location: usa
Posts: 189
Alex_Cole is on a distinguished road

yes the machine def and control def do have an impact on the generated code and also the toolpaths you have avalible at the time of programming.

The machine definition contains info about the physical machine and components, along with how coolant and feeds are handled. For example if in your machine build in the machine definition you do not have a 4th and 5th axis in your machine then when you are programming you should not have the multiaxis toolpaths available at the time of programming.

The control definition plays the largest part in the gcode that is output. In previous versions there were a series of switches at the top of the post processor that the user/post person would configure to change things like how arc's are output (IJK values or R values), If line numbers were output..things like this. Now in the control def most of these things are set in the different control topics. This does not apply to custom switches that might have been added to your post, and not all default switches are supported yet.

There are a lot of options in the machine def especially that are not supported yet in most post processors including the ones that come with the X system. These things somtimes can be added into your post so that they are supported but some things are not available in the NCI file yet so we cannot impliment them. They are there for future use.

Overall posting in the X system has proven to be very nice once you get some of the main differences figured out.


Just a side note: when you update a post from a previous version into X make sure you check the boxes to create a machine and control definition. When the post is being updated the system scans and reads all the switches at the top of the post processor and configures the control definition to match as closely as possible. This saves you the grief of having to go into the control def and configure everything. The machine def file that is generated is just a copy of the default which should support everything from 3 axis up to 5 axis machining. Once these files have been updated they are then associated together. Do not re-name or move these files from there current locaiton or they will loose there association to each other and then your program format will most likley change. THey must then be re-associated together for the post to function the way you are expecting. Explaining this here would take to long...I apoligise but your local reseller I am sure would be happy to walk you through it.


Hope this helps.

Alex
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6  
Old 05-09-2006, 10:38 AM
Rekd's Avatar
Community Moderator
 
Join Date: Apr 2003
Location: teh Debug Window
Posts: 1,877
Rekd is on a distinguished road

Writing a post would be a daunting task indeed. Your best bet would be to find a post that's close to what you want, and start modifying it.

Originally Posted by Alex_Cole
Mastercam's post processors are not really any specific programming language. It's kind of there own language where they have some of there own functions.
Actually, MP is Mastercam's propriatary programming language. It uses all the basic features of any other language, with it's own syntax, functions, methods etc.

In order to make minor modifications to your posts, you can likely open it and do things. But if you want to use the advanced features, (if/then/else, buffer files, using strstr() and brksps() etc), then you'll need a basic knowledge of just about any other programming language, plus the reference guide. There was a book several years ago for posts, but I don't know if it's available any more.
__________________
Matt
San Diego, Ca

___ o o o_
[l_,[_____],
l---L - □lllllll□-
( )_) ( )_)--)_)

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #7  
Old 05-22-2006, 02:03 PM
Mike Mattera's Avatar
Gold Member
 
Join Date: Mar 2006
Location: USA
Posts: 1,010
Mike Mattera is on a distinguished road

I wrote a tutorial about editing posts. It's an introduction to structutre. Click the link below and go to "Stuff for V8 & V9". Then to "How To Edit A Post".
http://www.mmattera.com/html/mastercam_stuff.html

Mike Mattera
__________________
Tips For Manufacturing Training CD's, DVD's for Mastercam, SolidWorks, Inventor, G-Code Training & More
http://www.tipsforcadcam.com
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 07-09-2006, 10:58 AM
 
Join Date: Apr 2004
Location: GA/USA
Posts: 87
doug6949 is on a distinguished road

Originally Posted by Alex_Cole
There is a PDF reference guide available from your local Mastercam dealer. Call them and ask them if they could send you a copy. Some distributors might charge for it, but now it is electronic instead of printed I am not sure if they still are or not.
alex
Some resellers prefer not to share information on how to edit posts as this is how they earn a living. I gave up trying to get the reference guide until I stumbled across one on ebay. I ordered and it turned out to be a pirated copy - oh well. At least I got what was promised and never delivered when I bought Mastercam.

The reference guide is helpful for understanding how post processors work but you must be aware that it was written by programmers. It is poorly organized, cryptic, and not very useful to someone who doesn't understand C programming (or C programmers). Expect to read it several times as you experiment with your posts.
Tweet this Post!Share on Facebook
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -5. The time now is 02:59 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353