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:

vortx

Verified Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by vortx

  1. I'm no expert at post editing but there's one thing about your code that I wouldn't do. I would put the "if" statement on it's own line instead of putting it in with the rest of your drill output. It looks like you don't need to worry about the G81/G82 but rather whether the existence of the dwell is allowing or canceling the rest of your line (the custom drill parameters). pdrill$ #Canned Drill Cycle feed_overide_dist = drl_prm1$ feed_overide_percent = drl_prm2$ pdrlcommonb pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl, prdrlout, if dwell$, *dwell$ *feed, feed_overide_dist, feed_overide_percent, strcantext, e$ pcom_movea
  2. Sounds like you could use the defaults file (click - SAVE PARAMETERS TO DEFAULTS FILE). I'm pretty sure most every parameter of a toolpath operation is stored in the defaults file and then loaded when you create a new toolpath. Each subsequent toolpath then uses the settings of the previous toolpath but you can always click "LOAD PARAMETERS FROM DEFAULTS FILE".
  3. If you are using RS232 to punch out your variables you might try the DPRNT command. Something like... POPEN #1=778. (FIRST VARIABLE TO OUTPUT) WHILE[#1LT1000.]DO1 #2=#[#1] DPRNT[#2[44]] #1=#1+1 G4P100 END1 PCLOS
  4. What version of Mastercam and what post are you using? Is the dwell always .5 seconds or is it determined by the spindle speed? If so, do you have a formula? This should be an easy modification either using the custom drill parameters in the tap cycle or using a custom drill cycle. If you haven't done much with post processors recently I would suggest becoming familiar with the post debugger (which is enabled through the Mastercam advanced configuration utility found on the Windows start menu) and also do your post editing in Code Expert. Code Expert will help you figure out which variables you need to use.
  5. I would look at the Big Kaiser modular system. I've only used a handful of these but I've been very happy with them and they offer great versatility. http://www.bigkaiser.com/kab-modular-tool-holders.php
  6. I was able to do this by simply changing the format for dwell to... fmt "P" 19 dwell$ #Dwell In the toolpath you would then put the dwell time in milliseconds. It will show a decimal in Mastercam but will post without one.
  7. I've used this same post configured with a similar piece of equipment and was able to use the misc int values to manipulate the output. I still had some issues with it rotating "A" when "B" was at zero but I can work around this behavior by changing my operation order around. This is the note I left for myself... Note: when programming the KOMA in Mastercam use the Misc. Int. variables to bias the tilt axis. To start with B- use Nutating bias = 2, Secondary Axis = 2. To start with B+ use Nutating bias = 1, Secondary axis = 1 After that you can use "2" in Secondary axis to keep B-
  8. Create a copy of your post and make the changes to the copy so you can revert back if something gets messed up. Create a string variable in the #Misc. string definitions post block strquot : "" assign the variable using the ASCII value for a quotation mark strquot = no2asc(34) now place the variable strquot at the beginning and end of all lines that might output code. You could use the n$ and e$ variables as a guide for what lines need to be modified and maybe even try a search and replace to make the changes. If you use a search and replace you might want to "Match whole string" so that you don't accidently change the wrong thing. strquot, n$, (other stuff here), strquot, e$
  9. Hi, Thank you for the response. I've tried multiple techniques for resetting the logic (including your suggestion) but in order to get it working I ended up needing to get trickier. The problem wasn't about resetting at a tool change but rather resetting between operations for the same tool. If I just added a line to reset the variable it would get reset too early and the process would only execute once. To recap my goal: I wanted to work around the tombstone using a transform operation with the work offset numbers increasing for each part, and then start back at the beginning, (or a new plane with the same tool) and work around the tombstone again with the work offset numbers starting over and matching the numbers that were used the first time around (rather than continually counting up). Anyway, I did manage to get it working and I will share just in case anybody else can gain from this. Keep in mind that there may still be some bugs to work out... I used two misc. integers in the transform operation custom parameters. One to represent the number of parts on each side of the tombstone and one to represent the number of tombstone faces. A value in these variables indicates to the post to use the work offset number indexing section of the post (which I added) rather than the normal work offset numbering. I programmed each part on the first side of the tombstone conventionally with individual work coordinates for each part. The additional sides of the tombstone are programmed with the Transform operation (rotate by toolplane). I set the Transform operation Work Offset Numbering dialog to "Maintain source operations" so Mastercam outputs the same work offset numbers for the transformed parts as the original parts. I then intercepted the work offset numbers in the post so instead of outputting the original numbers they were increased by 1 for each new part. So if the first side uses G54.1 P1 and P2, side two will use P3 and P4, side three will use P5 and P6, etc. In the post, each time an index occurs, the work offset numbering increases but the number of remaining parts is counted down. When the number of remaining parts reaches zero the post resets the variables and returns to conventional work offset numbering. This can be then be repeated for additional transform operations (in a new plane for instance). These are the changes I made to the post... #variable Initializations pwcs_index : 0 #used to increment work offset number in tool plane transform index_val : 1 #used to count the number of indexes made trans_mi2temp : 0 #represents parts/side - passed with trans_mi2$ trans_mi3temp : 0 #represents number of sides - passed with trans_mi3$ trans_mi3flag : 0 #enable/disable work offset number indexing #reset variables at tool change post block index_val = one pwcs_index = zero trans_mi3flag = zero #index output post block index_val = index_val + 1 #count up by 1 each time tombstone indexes pwcs #G54+ coordinate setting trans_mi2temp = trans_mi2$ #value set in transform operation - represents number of parts/side if mi1$ > one, [ if (trans_mi2temp > 0) & (trans_mi3$ > 0), #execute only if work offset number indexing is turned on [ if (trans_mi3temp <> trans_mi2temp * trans_mi3$) & (trans_mi3flag <> 1), #run once to set trans_mi3temp value. Flag is set to prevent from running again. [ trans_mi3flag = 1 trans_mi3temp = trans_mi2temp * trans_mi3$ ] if (prv_indx_out <> fmtrnd(indx_out)) | (prv_cabs <> fmtrnd(cabs)) not (trans_mi3temp <= 0), #increase work offset numbers on rotate [ pwcs_index = trans_mi2temp * index_val #multiply number of parts per side by number of indexes - this is added to the base work offset number trans_mi3temp = trans_mi3temp - trans_mi2temp #count parts down on rotate so numbering can be reset when complete ] if trans_mi3temp <= 0, #when all indexing is complete, reset work offset numbering and flag [ pwcs_index = 0 index_val = 0 trans_mi3flag = 0 ] sav_frc_wcs = force_wcs if sub_level$ > 0, force_wcs = zero if workofs$ <> prv_workofs$ | (force_wcs & toolchng), [ if workofs$ < 6, [ g_wcs = workofs$ + 54 + pwcs_index #output work offset with value modifier *g_wcs ] else, [ p_wcs = workofs$ - five + pwcs_index #output work offset with value modifier "G54.1", *p_wcs ] ] force_wcs = sav_frc_wcs !workofs$ ] else, #no work offset number indexing so normal output . . .
  10. Hello, I am programming a tombstone (horizontal B axis) where there are multiple identical parts on each face of the tombstone (four parts on B0 which are then copied around to the additional sides). My approach is to program one side of the tombstone completely and then use a transform (by toolplane) operation for each tool to rotate the toolpath operations around the tombstone. This works great and posts out nicely except when it comes to work coordinate system numbering. I have tried many variations of manipulating the wcs function in both the transform operation(s) as well as the WCS-View Manager but the result is that Mastercam will post out one addition WCS per additional tool plane regardless of the number of parts or WCS's used in the original operations. Everything else (B angles etc.) is posting perfectly. So I decided I could solve this by adding a few features in the post processor using the custom parameters available in the Transform operation. I set the number of parts per side as a miscellaneous integer in the Transform / custom parameters dialog and accessed it in the post via trans_mi2$. I created a variable and indexed it by 1 each time the tombstone rotated, multiplied it by the number of parts in trans_mi2$ and added it to workofs$ for the WCS output. I had to set the Transform work offset numbering type to "Maintain source operations" which gave me an error (WCS used in more than one view) during posting but the output successfully incremented the work offset numbering to give each part on each side it's own unique work offset number which incremented sequentially. So here's the problem... I can't figure out how to reset it. It continually adds to the work offset numbering so it only works if I start at one point and work around the tombstone sequentially. I have multiple views on the part and not every tool will be able to cut in the same sequential order as the previous tool(s). If I could figure out how to tell it to "start over" I could design the work offset numbering (or add more work coordinate systems as numbering start points) to make it post complete with no hand edits but as for now I will either have to hand edit the program or scrap the Transform operations and program each side individually just for the proper work offset numbering. The post debugger shows me that trans_mi2$ stays modal so when the Transform operation is complete and another "conventional" operation starts, the value in trans_mi2$ is in effect (setting off the logic that told it to index the WCS number) so the numbering just continues to increment. I've tried several techniques to "reset" the numbering with no success. The only thing that works is a tool change so I could select "Force tool change" but that wouldn't be very ideal. Here are some details of what I have and what I've done... Mastercam X7 16.2.0.4 The post is a customized version based on the Generic Haas 4X Mill.pst [post_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V16.00 P0 E1 W16.00 T1398767629 M16.00 I0 O0 # Post Name : Generic Haas 4X Mill.pst # Product : Mill # Machine Name : Haas # Control Name : Hass # Description : Generic 4 Axis Mill Post # 4-axis/Axis subs. : Yes # 5-axis : No # Subprograms : Yes # Executable : MP 13.0 Some snippets of how the indexing works... trans_mi2temp = trans_mi2$ if mi1$ > one, [ if trans_mi2temp > 0 , [ if (prv_indx_out <> fmtrnd(indx_out)) | (prv_cabs <> fmtrnd(cabs)), #index wcs on rotate [ pwcs_index = trans_mi2temp * index_val ] sav_frc_wcs = force_wcs if sub_level$ > 0, force_wcs = zero if workofs$ <> prv_workofs$ | (force_wcs & toolchng), [ if workofs$ < 6, [ g_wcs = workofs$ + 54 + pwcs_index *g_wcs ] else, [ p_wcs = workofs$ - five + pwcs_index "G54.1", *p_wcs ] ] force_wcs = sav_frc_wcs !workofs$ ] else, #normal output and also the variable which is set in the post block that indexes the tombstone... index_val = index_val + 1 If you're still with me here maybe you can give me some ideas? I've made it work but how do I shut it off without a tool change? I've tried using other variables as flags to say "STOP" but so far it hasn't worked.

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