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:

ProTip: How to set Control Definition Defaults


Colin Gilchrist
 Share

Recommended Posts

Thanks for taking the time to explain Colin. I am having a bit of a problem with adding a post to the control definition. It allows me to add it fine but when I save and leave MC tells me I have not saved. When I loop back and check it the added post is not there. Any thoughts?

 

Here are my thoughts:

 

  • When you add a new post using the "Post Processors" button, you are selecting a post processor, that resides inside a specific folder. There is a header line at the top of the post processor that tells Mastercam what "version" the post is compatible with. It could be that you are selecting a post that isn't "keyed" to your specific version. I'm not sure when this "check' takes place, but I would suspect that the software might check it upon trying to save. If you "update" a post for a new version, but you tell the Migration Wizard to use the "old version" folder structure, Mastercam can potentially update the "old post" to the new version, but keep the post in the old version's "shared" folder. The migration wizard will create the "new updated" post, but will also place a copy of the original version, with a different file extension. So an "updated" X9 post would also create a file with a "pst_vX8" extension, that would reside inside the same folder. If you have a file extension like this, inside your "shared mcamX8\Mill\Post" folder, that is likely what happened. (you can delete the "new" post, and rename the extension of the "old" post back to ".PST", and it will undo the update...)
  • When you select a new post processor to add to the list, you will see a Plus Sign character "+" next to the post when you first add it. (Make sure you also "select" the post you just added in the drop down list. When you see the + character, the post is not linked. Pressing the "save" button will link the new post with the CD settings in the dialog. This will now show a Green Check Mark next to the post. If you don't have the Green Check Mark, the process isn't complete, and the post isn't linked.
  • Make sure your Post is not being edited inside a text editor. When you save "Post Text" --> Things like "Misc Integers" or "Real Numbers", or you customize the "Drill Cycles", these strings are saved to the end of the PST File, in the "Post Text" section. I've seen it where having the PST file open will "lock" the post.
  • When you save the "defaults" for a Control Definition file, these are saved internally to the CD, and are not linked to a specific post processor. So if you start by saving the defaults, these settings will always populate when you "link" a new post.

So those are my thoughts.

Link to comment
Share on other sites

One additional thought I have when you are having trouble is to start fresh.
 

Here is a procedure for setting up a new MD, CD, and PST file, from scratch. (Well, at least starting from the unmolested "default" files anyway...)

 

To create a new 5 Axis Mill Machine, Control and Post, do the following:

 

  1. Start by taking the "Generic Fanuc 5 Axis Mill Post", in the "mill\post" folder, and make a copy of the Post. Also make a copy of the PSB file. This is the "binned" or encrypted portion of the post. You must have both files, together in the same folder, and they must have the exact same name. In this case lets name each file "5X_TRUNNION_MILL". So you will then have "5X_TRUNNION_MILL.PST" and "5X_TRUNNION_MILL.PSB" in your folder. (Hint, while renaming the first file, highlight the file name only and press CTRL + C to copy the file name string.)
  2. Go to the "CNC Machines" folder, and copy/paste the Generic Fanuc 5X Mill.Control-8 file, and rename the copy to "5X_TRUNNION_MILL". (this is where having the name string copied to the clipboard helps.)
  3. Do the same thing for renaming the "Mill - 5 Axis - Table / Head Vertical" Machine definition. This is the only file of the four I listed that has a different "default name" from the "Generic Fanuc 5X Mill". Name the MD to match the other files.
  4. Now that you have all files named the same, except for the file extensions, start with a "fresh" session of Mastercam. (close and re-open if necessary, or do Machine Type > Design, then File > New.) Open the Control Definition Manager. A small dialog will appear that allows you to open an existing CD, or create a new one. Browse to, and open the new CD you created.
  5. Click on the Post Processor button. There will be two entries in the list; the "default settings", and a linked PST file. Select the linked post, and use the "Delete" button. That leaves only the "defaults" in the list. Close the select post dialog box.
  6. Save the CD file.
  7. Edit the "Default settings", until every parameter is setup the way you want it to always be.
  8. Save the CD file again. This file now has the proper "Default" settings for your new machine. (There will only be a "anti" sign (circle with slash) next to the Defaults, because they are not linked to a specific post processor.)
  9. Now, press the "Post Processors" button, and use the "Add" button to add a new post. Browse to the post you just created/renamed. This will add the entry in the list. Press "Ok" to close the selection dialog.
  10. In the Drop-Down, make sure the new post you just added is selected. You will see a "+" plus sign next to the post. The Control Definition Manager may warn you that "you are selecting a new Control Definition, do you want to save the existing definition", or something like that. If it does warn you, just say "yes" or "ok".
  11. Press the Save button. Mastercam will validate your post, and put a Green Check Mark next to the linked post. If you don't have a green check mark, your CD settings are not linked to the post processor.
  12. Close the Control Definition Manager.
  13. Open the Machine Definition Manager.
  14. Edit the Kinematic Components to represent your actual machine configuration.
  15. NOTE: the MD does not control any of the NC setup or output. This is done for the 5 Axis Post, inside the post only. The 4X post reads some data from the Rotary component for the 4th Axis. But only with a 4X Post. The 5X Post is only setup inside the post itself. "Then why setup the Kinematic Tree at all?" <-- I can hear you ask it now. Because the Tool Paths themselves are checked for compatibility with the MD kinematics.
  16. Set your Coolant Options in the MD.
  17. Make sure the MD is linked to your new CD.
  18. Save the MD.
  19. (NOTE: for 5X machines, you will need to fully configure the PST file settings!!!)

 

That's it. Your MD, CD, and PST files (PSB too, for 5X), all have the same name, and are properly linked together. The process is the exact same for Lathe, or Router, just substitute a LMD or RMD file, instead of the MMD.

 

The process is also the same for a 3X or 4X post, without needing to worry about a PSB file. The 4X Post does read the Rotary Component settings for things like "continuous rotary" or "index only", the rotary direction (CW vs. CCW). It does not read the Rotary Axis Limits.

  • Like 1
Link to comment
Share on other sites

Every Control Definition file has a set of "Default Settings" that are used (you might have guessed), by default.

 

Colin,

 

Since I installed X9 months ago (but never really setup the control def or used X9 other than looking around), it was kinda too late to use your method. So, I went into X8, imported my settings into the default settings, used the migration wizard in X9 to only update machine/control defs, and all is good in X9 now.

 

I have a general question. Where are these default settings stored, inside my customized control def?

 

Thanks for sharing these tips!!!

Link to comment
Share on other sites

Thanks Colin, it was the second item. I need to go back to the drop down list and select it. Works as planned now. I am not one complain and I understand the reasoning behind the control and machine definitions and it is good that there are just copies of each that are included with each separate file much like importing tools. I do though have to agree with Micro here a bit, it all seems a bit complex at times.

Link to comment
Share on other sites

Thanks for the comments everyone. I agree with all of you that this process seems overly complicated sometimes. The hardest part is just knowing where the settings are pulled from, and how the whole system works.

 

The ability to set "Control Definition Defaults" has been around since Mastercam X first came out, but nowhere was the process explained in detail to the average user.

 

If you know how all the tools and utilities work together inside the software, you can do some pretty incredible things. But you really have to know what you are doing, and in some ways CNC Software doesn't want to make it easier for you as a user. They want to build an ecosystem that allows their Resellers to make money. They do that by building the software framework, and teaching the Resellers how to customize the software for the end user. This is a service they charge for, and in some ways, I think that is actually a good policy. I think the issues occur because not all Resellers are created equal. Most are very knowledgeable, but there are certainly some that are lacking in technical capability, and I think some end users suffer for that. In many ways, that is why I try and help so much. At one point, I was that lost user. I happened to grow up in Seattle, and the Washington State Reseller is actually fantastic, so I consider myself lucky in that regard.

 

Ok, one more tip on the Control Definition Settings:

 

  • Mastercam ships with a Chook installed called "CD Compare". This utility lets you compare the CD settings from one "post" to another. This includes the ability to query the "defaults" to determine if they match your current post settings.
  • Unfortunately, CD Compare is not cross-version compatible. That means you can't compare a X8 to a X9 CD.
  • After you do your Migration Wizard, I recommend you use CD Compare to check the "Defaults" vs. your "current post" settings.

To run CD Compare:

 

  1. Start by pressing ALT + C on your Keyboard, or use Settings > Run user application.
  2. In the dialog box, open the CD_Compare folder
  3. Double-click on CD_Compare.dll
  4. Use the left "open" button, and browse to your CD. Press "ok".
  5. This opens the "select type and post key". The "Defaults" will list "NONE" as the post. Click this entry.
  6. Press the right "open" button. Select the same CD.
  7. When "select type and post key" comes up, select your actual post (file path).
  8. Once both are loaded, press the "=?" button to perform the comparison.

 

The CD_Compare utility will go through and compare all the different settings. You can then see if anything isn't set correctly.

 

Note that when you use CD_Compare, there will be at least one section that shows "differences". The "Default Misc Values" are stored in the "Post text" section of the PST file itself. So if you have default values "//1", "//2.//50.", then those numbers won't be saved in the "Defaults", since they are associated to a post processor, and the defaults do not have a post linked to the settings...

Link to comment
Share on other sites

 

When it was originally conceived, the CD was created with the ability to link and control multiple post processors, and have separate settings for each one.

 

Thank for this Colin!

 

Do you do this with your setups now? I really like the idea of having one post and just have different machine definitions. We change machine setups daily so I am forced to constantly change machines, update parameters and repost. My problem is I am sitting in a shop with control over 17 machines with practically every Fanuc controller known to man (0M,15M, 16M, 16i, 18M, 31i) Okuma OSP100, 200, haas controls on routers and tool room mils, mazaks with 640 fusion, cam m-2. All of these have different settings because my machine tools span from like the late 80's to early 2k. Some m codes work on some machines, some need different m codes. I know I could just modify the individual posts for each machine but then it breaks consistency with my mastercam files.

Link to comment
Share on other sites

Thank for this Colin!

 

Do you do this with your setups now? I really like the idea of having one post and just have different machine definitions. We change machine setups daily so I am forced to constantly change machines, update parameters and repost. My problem is I am sitting in a shop with control over 17 machines with practically every Fanuc controller known to man (0M,15M, 16M, 16i, 18M, 31i) Okuma OSP100, 200, haas controls on routers and tool room mils, mazaks with 640 fusion, cam m-2. All of these have different settings because my machine tools span from like the late 80's to early 2k. Some m codes work on some machines, some need different m codes. I know I could just modify the individual posts for each machine but then it breaks consistency with my mastercam files.

 

"Do you do this with your setups now?"

 

Yes, and no. Lol.

 

The main issue has to do with how the posts were setup originally. Almost all of Mastercam's post processors started life long before the Mastercam X series came out. For that reason (in my opinion), stuff was added to the posts to read only some parameters from the Machine Definition file. Part of the reason for this is due to complexity. There is so much variation between machines on the market. From the controller, to the kinematic layout of the machine itself. Add to that the fact that you can re-configure just about every machine behavior with control parameters, and you've got a mess on your hands.

 

For your particular situation, I do think there would be some advantage to linking multiple post processors to a single .Control File, but only for machines that share the same model of control, and have similar setup requirements.

 

The biggest issue (and the reason I started this thread), is that you only get a single set of default values for a Control Definition. So whenever you update your system, all of the default values get used for any of the posts being linked. Let's pick an example. Say you had three different machines in the shop that are Okuma, and they all used the OSP 100 control. If all of the settings are the same (line numbers, arc format, tolerance values, tool staging, ect., then you could have a single set of "default values", yet still link 3 different post processors. (Also assuming you have slightly different NC code output requirements.)

 

The issue you'll run into, again, is the defaults getting used when updating Mastercam to the next version. So it really isn't practical to try and setup a single Control Definition file, that would be linked to every single post you use. Could it be done? Possibly, but I think it is actually more trouble than it is worth...

 

One of the biggest issues you will run into trying to manipulate the post processor using a Machine Definition, is the setup of your Tool Planes. The Tool Planes in Mastercam are tied to the System Top Matrix. So it makes it a real pain if you try to move a job that has already been programmed from a Vertical to a Horizontal, or vise-versa. Same when moving from 4X machine to a 5X, and so on.

 

For some of my customers I do go in and setup the post to read the orientation of the rotary components, and do things like set the rotary letter addresses, CW/CCW direction, and things like that. It takes a lot of work to write in the logic to do this, which means in general that it is also expensive. Dave Thompson from Postability uses his own "base post" code, and has successfully setup all of his posts to use the MD, like it should have been done in the first place. Can it be done? Yes. But it is also not as "easy" as you would think it is.

 

You mention "breaking the consistency of my Mastercam files". I'm not sure what you mean by that. Could you please elaborate?

 

Is it that you want the ability to easily move a programmed job from machine to machine?

 

For Posting, there is a little bit of a trick. When you go to post, the posting dialog comes up. If you press CTRL + ALT + SHIFT + "P" on the keyboard, it will activate the "select post" button. You can then select any post processor, and Mastercam will run using your MD/CD settings, but use the different post you selected.

 

Another option would be to create a "master" post processor that would manage the posting process, and to call MP.DLL multiple times, pass it a copy of the NCI, but call a different post processor. So you could process the same file multiple times, each time outputting a different NC program for a specific machine. It can be a pain to setup, but it means you can "post" once, and get the same program formatted for all the "similar" machines in your shop (kinematics must match).

 

In the end, it would behoove you to create a new post processor for each machine on your shop floor. That way each can be customized to output the correct formatting and correct M-codes for your specific machine. Then it is simply a matter of replacing the MD/CD/PST when you need to post for a different machine. OR.... Just keeping the same MD/CD settings (since these are stored inside the Mastercam file), and using the "select post" trick to post with a different post processor. That at least saves you the step of having to do a "replace" on your MD/CD...

  • Like 1
Link to comment
Share on other sites

I have no doubt that kind of task would be monumental.

 

For breaking consistency what I mean is say I post a program for one of our OSP100 controls. The diameter offsets has to match the tool number of course. Now, fast forward 5 hours later and they want to run it on the early 90's fanuc 15m. The diameter offsets have to be 50+tool number. If I just go in and change the machine, the diameter offsets will not change automatically. I go into each one and update it, and regen.

 

I could just set up the logic in the post to do this addition for me, but I want to see that it matches in my mastercam file. I wouldn't get that if I just set up the post to do that. There are other examples this is just the easiest one.

 

As far as setting the defaults go, every time I upgrade to a new version I always do the defaults by hand. I know I could do this a different way but I like to think of it as a rehashing of what I used for defaults in the previous version. Should I change things or check out the new stuffs put in the defaults. Its kinda weird I guess but I don't mind doing this.

Link to comment
Share on other sites

Honestly, that Length/Diameter offset issue can easily be handled on the post side, by ignoring the NCI data altogether.

 

In your "regular posts", setup a Global Formula at the top of the post (make sure it starts in the first column!):

 

For Tool = offset:

tlngno$ = t$
tloffno$ = t$

For your machines that have a +50, do this instead:

tloffno$ = t$
tlngno$ = t$ + 50

Doing that at the top of your posts means you never have to worry about what offset value is setup for a given operation. It will always post out perfect NC code, and eliminate the hassle of having to change MD/CD and regenerate the toolpaths...

Link to comment
Share on other sites

Thank for this Colin!

 

Do you do this with your setups now? I really like the idea of having one post and just have different machine definitions. We change machine setups daily so I am forced to constantly change machines, update parameters and repost. My problem is I am sitting in a shop with control over 17 machines with practically every Fanuc controller known to man (0M,15M, 16M, 16i, 18M, 31i) Okuma OSP100, 200, haas controls on routers and tool room mils, mazaks with 640 fusion, cam m-2. All of these have different settings because my machine tools span from like the late 80's to early 2k. Some m codes work on some machines, some need different m codes. I know I could just modify the individual posts for each machine but then it breaks consistency with my mastercam files.

 

It can be done.  I got this tip from EX-wccprogrammer:  http://www.emastercam.com/board/topic/78945-mastercam-posts/

 

Now I have one post that does 15 different lathes, M control, T control, 2 axis up to 9 axis twin spindle.  Each one has it's own MD and CD, I just pick machine and post.

  • Like 1
Link to comment
Share on other sites
  • 2 weeks later...

Hi Dan,

 

If you start with setting the "Defaults", you basically avoid the steps of having to "import" the settings. So if you start by modifying the Default values, and then add a post, it will use the Default Settings, and you are good to go. That is an important thing to be aware of, so thanks for pointing it out.

 

The issue with "Post Text" is that those strings are physically written to a post processor (.PST) file. Since the "Default settings for control type" doesn't have a PST file attached to the "defaults", there is nowhere to store these strings. (A PITA, I know!)

 

So that is basically the reason I recommended to setup your post first, then import the settings back into the defaults. I just didn't give you the reason why, which is that the strings for "Post Text" get stored inside the post processor itself. During the "Update" process, the old post (say X6 for example) gets copied to the new location (so the "Post Text strings" follow along automatically), but since we are writing to a "new folder location", the Control Def goes and grabs the default values. This behavior creates a mess, since you would think that "update" would just copy the current CD settings from your "linked post", but it doesn't work that way. Part of that has to do with the idea that you can "link" multiple posts to a single CD. (In practice, almost nobody does this. It is MD/CD/PST all named the same...)

 

There is a trick available (I think) that used to work. When you create "Post Text" at the bottom of a post processor file, it is normally done through using the Control Definition Manager utility. If you know what you are doing, you can also modify these strings at the bottom of a post processor manually. They are just "text", you just need to know the proper format.

 

The format for the "Post Text" is to allow multiple "Control Definitions" to be linked to a single post. To do this, each "Post" has an entry under the "Post Text" section. There is even an entry for "Default", which does give you the "default" text strings. They only show up though when you "link" the post in the CD manager...

 

Each "Post Text" section starts with a special "section identifier". This entry lists the CD "Type" (Mcam Product type), and "Post Key" which is just the name of the PST file. A typical "type and key" entry would look like this:

 

[CTRL_MILL|GENERIC FANUC 3X MILL]

 

The format is as follows: [   product type     |    post name   ]

 

The Pipe Character ( | ) is used to separate the type and name, and the name must match exactly the name of your post. If it doesn't (if you rename the post for example), then Mastercam will grab the "Default" strings. These are always listed as: [CTRL_MILL|DEFAULT]. (Note, it would be "CTRL_MT_LATHE" for 4X lathes, and so on. Different "types" based on the capabilities of the control/machine.)

 

So if you just setup your "CTRL_MILL|DEFAULT" strings as your "defaults" (*You have to do this manually by editing the post, so be careful!), you can have "default" text strings for your post processors.

 

One further note:

 

It is also possible to have a Control Definition that has only "Default settings for control type", and doesn't have a post linked to it. When this condition occurs (basically you create a MD, and select this CD that has only defaults, then save the MD), and you load your MD into a Mastercam session, the file will now contain a MD and a CD, but not have a post selected. In Machine Group Properties, it will show "NONE" under the post processor display.

 

When you create Tool Paths and post them out, the "post processing dialog" will also show "NONE" listed, and the "Select Post" button will be active. You can then just browse and "pick" the post you want. Mastercam will bark a warning, but you can go through and post it. Once you select a post processor, it will then automagically create that association in the background, and list that post under your MGP settings.

 

If you want to change to a different post, you can just press CTRL + ALT + SHIFT + "P", and the button will become active again...

 

I think the only advantages to doing this is that you get a single place to edit the strings (inside the post), the strings are the same (no matter what CD settings you've got), and you don't have to worry about updates, since the CD settings are always the defaults.

 

One final note: I don't use that method. I do set "DEFAULT" post text strings inside the post, and set the "Default settings for control type" inside the CD, but I always link them together. That way I get the MD, CD, and PST files by selecting only the new MD. If I happen to want to launch a different post processor though, I always use the "Select post" trick...

 

Hope that helps,

 

Colin

  • Like 9
Link to comment
Share on other sites

Hi Colin,

 

 

 

 

I do set "DEFAULT" post text strings inside the post, and set the "Default settings for control type" inside the CD, but I always link them together. That way I get the MD, CD, and PST files by selecting only the new MD. If I happen to want to launch a different post processor though, I always use the "Select post" trick...

 

So this means that your file's the association to a post is stored only at the mastercam file level?  Wow - never thought about that. 

 

It sure does sound like it would simplify some things.  I've been surprised multiple times by the number of "new" post text sections appended on the posts when I've been fooling around trying to figure this out.  

 

I'm not sure if this is the best solution for us.

 

Assuming my control definition settings match the default control exactly - if I take the extra step of going to the post and copying my post text to the default section, I should be able to avert any problems when updating?

 

Thanks again,

Dan

 

  

  • Like 2
Link to comment
Share on other sites

Hi Colin,

 

 

 

So this means that your file's the association to a post is stored only at the mastercam file level?  Wow - never thought about that. 

 

It sure does sound like it would simplify some things.  I've been surprised multiple times by the number of "new" post text sections appended on the posts when I've been fooling around trying to figure this out.  

 

I'm not sure if this is the best solution for us.

 

Assuming my control definition settings match the default control exactly - if I take the extra step of going to the post and copying my post text to the default section, I should be able to avert any problems when updating?

 

Thanks again,

Dan

 

Hi Dan,

 

While you technically could do it that way, I don't recommend it. Just wanted to make this thread contain as much knowledge as possible about how the CD works "under the hood".

 

I recommend you stick with the process of creating a separate MD, CD, and PST file for each machine, and all three files using a unique name (and all three strings matching exactly.)

 

Especially when setting up a new Post, it just makes sense to use the CD to set the settings for the specific post processor (parameters), and use the "post text" section to modify your Misc Values Text Strings, and Drill Cycles. (BTW, editing these strings changes the options for your Tool Paths inside the toolpath dialog box.)

 

That gets your "parameter settings" for the PST file, and the Text Strings taken care of. After that, then use the "import" trick to set the "Default settings for control type". That will set you up with a properly configured CD, a modified PST file (containing the text strings), and a CD with "Default" settings of your choice.

 

Yes, copying your Post Text section from "your post name" to the "CTRL_MILL|DEFAULT" settings will ensure that those strings show up as the "Default" strings, no matter where you post processor is located.

 

Regarding "storage at the Mastercam File level", technically what happens is this:

 

  1. When you select a "Machine Definition" file, Mastercam will load a copy of the MD, and a copy of the CD into your Operations Manager. This places a copy of the MD and CD databases inside your "MCX" file.
  2. Why make copies? -> loading a copy into your MCX file allows you to make "file specific" changes to both the MD and CD settings. These changes only effect the current Mastercam MCX file, and do not carry forward into the "library" copy. This is why you should always make "permanent" changes by going through the Machine Definition Manager, then opening the Control Definition Manager. If you have a MD/CD/PST currently loaded in your Machine Group, and you go through "MDM -> CDM", then when you save the changes to the Machine Def, Mastercam will prompt you to ask if you want to "replace" the Machine. (say "yes" to this). That method (going through the "managers" to make changes), allows you to make a "library" change, and also have that change carried forward into the active file, by doing a "replace" on the MD.
  3. If you have a Machine loaded in your Ops Manager and you go into Machine Group Properties -> Files Tab, and press the "Edit" button for the Machine Definition, then you are making "local" changes to the MD and CD. These changes are only being made to the MD/CD that have been copied into your MCX file. Again, the reason for this is to allow you to make "file specific" changes. Say you have a Right Angle Head, setup for a specific job, using 3 different "stations". You can set that all up inside the "File Copy" of the Machine Definition, and those changes would apply only to the active file that is in use. Or say you want to try and fit a large program into your control with limited memory. You might go into the File Copy of the CD, and turn off "spaces between NC addresses, and remove Sequence Numbers...

 

Really, the key things to remember in the process are setting the "default parameter values" in the "Default settings for control type", and setting the "Default" strings in the Post Text section. (copying the modified ones manually to the "post text default" section. Doing those two things will avoid 99.9% of the issues people have when updating Mastercam to a new version...

 

Hope that helps,

 

Colin

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