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 post be modified to output variables for G54, G55, etc...?


Recommended Posts

We use a mori horizontal with a pallet changer, and the location of the two pallets is marginally different but they have the same setup and are used for production jobs. Is there a way to get mastercam to post out G#500 for all offsets rather than G54, G55, etc.? I know this is a kinda jenky way to run it, but the machine is set up as 3+2 axis, program off a single work offset, and just use a template and multiples of G54 to get our locations for B axis rotations. It works fine once I got the template for the stops and center of rotation updated, but I know it far from the best way of doing it. 

 

We add this line at the start of all programs for that machine, so #500 is determined by whatever pallet happens to be in the machine.

 

(MORI SEIKI NH5000)
(USE #X STOPS)
(PALLET CONFIRMATION)
#501=#147
#500=[#501+53] 
(G54 ORIGIN COORDINATES) 
#5221=-14.375(G54X0) 
#5222=-24.402(G54Y0) 
#5223=-23.3743(G54Z0)
(G55 ORIGIN COORDINATES) 
#5241=-14.375(G55X0) 
#5242=-24.402(G55Y0) 
#5243=-23.3793(G55Z0)
 
New to the shop, and trying to get the posts set up to be a little more machine friendly and require less editing after posting a file.
 
This is what I need the post to spit out for the first few lines in a toolpath.
 
G190A0 
G0G90G#500X-.3264Y1.218B0S2000M3 
G43H7Z1.M8 
 
Thanks for any feedback!

 

Link to comment
Share on other sites

Not yet, don't know if our current license covers post edits, we're still running X8. I've made some headway sorting out other issues myself, but I was wondering if there was any way to get it to post out the # character, since it comments out anything following it on a line...

Link to comment
Share on other sites

Ok, I'll admit, I'm a total noob with this stuff. We dabbled in post editing in school, but that was 5 years ago...

     if mi1$ > one,        [        sav_frc_wcs = force_wcs        if sub_level$ > 0, force_wcs = zero        if workofs$ <> prv_workofs$ | (force_wcs & toolchng),          [          if workofs$ < 6,        	*"G" 35 "500"          else,            [            p_wcs = workofs$ - five            "G54.1", *p_wcs            ]          ]        force_wcs = sav_frc_wcs        !workofs$        ]

That is just giving me # 500 in place of the offset, instead of the G#500 I'm looking for.. I know I'm overlooking the simple solution here...

Link to comment
Share on other sites
     if mi1$ > one,
        [
        sav_frc_wcs = force_wcs
        if sub_level$ > 0, force_wcs = zero
        if workofs$ <> prv_workofs$ | (force_wcs & toolchng),
          [
          "G#500"
          ]
        force_wcs = sav_frc_wcs
        !workofs$
        ]

You can use "special characters" now inside strings. However, if you have any issues, then sometimes it is necessary to use Single Quote marks on the string:

     if mi1$ > one,
        [
        sav_frc_wcs = force_wcs
        if sub_level$ > 0, force_wcs = zero
        if workofs$ <> prv_workofs$ | (force_wcs & toolchng),
          [
          '"G#500"'
          ]
        force_wcs = sav_frc_wcs
        !workofs$
        ]

You can't "force" a string variable, which is why your *"G" failed...

Link to comment
Share on other sites

Ah ty, that did it. Thought that was the first thing I tried, but I don't think I tried it without the *. One issue down, many more to go... they had most of this set up at one point, but had all of the machine defs and posts stored on a local HD, that tanked on them a couple years back... so I'm rebuilding all the machine definitions and tweaking the posts for every machine in the shop... luckily we're not busy and I've been getting by hand editing a LOT after post when I get new parts.

Link to comment
Share on other sites

If your Mori has a probe and your pallets are marginally identical,  you can grid shift the machine to think the pallets are identical.

 

on second though i was thinking of a pallet pool where you calibrate each mill the same using the same tombstone.

Edited by mkd
Link to comment
Share on other sites
  • 2 weeks later...

Do you have a copy of the MP Post Documentation (approx 57 Mb PDF file)? This is a "complete" guide to the language, although you have to know how the guides evolved to get the most out of it.

 

Example:

 

  • V9 documentation was 3 volumes, almost 2000 pages.
  • Newer stuff is in the "NCI and Parameter Ref Guide" for your specific version.
  • Search in V9 guides without using dollar sign "$", because older documentation hasn't been updated to reflect new changes to MP language.
  • Older V9 guides follow syntax of V9. Newer "X" stuff has additional "formatting" rules, makes the language more "readable", and consistent.
  • MP is very powerful, and most closely resembles "Standard C", with some significant formatting tweaks to the commands used, and structure.
  • MP is a "scripting" language. Most people don't understand how that limits you, and forces you to do things "in a certain way" to get around those limitation. On the other hand, being a scripting language, it is very flexible to get the output you want/need. MP has almost 400 different commands and functions to enable some pretty sophisticated control structures to be created.
  • Like 1
Link to comment
Share on other sites

Yeah, I have the most recent version, but thanks for the pointers! I'm still learning, and definitely taking the time to double check what my posts are spitting out, and test a few different toolpaths with each change I make.

 

Was feeling pretty overwhelmed at first, but you guys have been extremely helpful. I guess for the last 10 years they ran mastercam here, nobody ever bothered to set it up to post a axis moves, just used a generic 4 axis post and hand edited everything after post to add in A moves and match each specific machine.

 

Still trying to find a way to lock the Y axis for some toolpaths and just cut with x, z and a, but not a pressing need right now. 

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