Zaffin_D
-
Posts
374 -
Joined
-
Days Won
1
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Posts posted by Zaffin_D
-
-
Just so you know, in 2017 or later you can use the tt_count$ variable or times_used = opinfo(52, 0).
- 3
-
Do you have a pz$ block in your post?
-
Have you tried adding the format round function?
if ((prv_x$ = fmtrnd(x$)) & (prv_y$ = fmtrnd(y$))), "M113"
-
On 7/30/2018 at 2:52 AM, David Colin said:
It can be done but as already said, best is to split in 2 ops. (or ask CNC a switch to calc rough passes with computer comp only...)
IMHO it can cause serious issues tweaking a post that way... you can count passes number set in Mastercam GUI but if CNC changes/improves routines in a future release (as it's been done in 2018 if I remember correctly) you probably will need to be careful (I ve already been bitten...)
Another stuff to be aware: what if a user, one day, has great idea to post a toolpath with 'control' comp setting? It will make a crap part and a cutter broken...So don't forget to support that case in your post to output G41/G42.
Though I disagree that creating (and maintaining) two ops for this is the best solution, that's not why I'm responding.
You said you've been bitten by a change CNC made before, was it a change made to MP.dll? Can you shoot me an email about this? I'd like to help if I can.
-
That's not correct according to the documentation;
QuoteMake sure you follow these guidelines:
The [STARTBIN] and [ENDBIN] keywords must each be on a separate line and
start in the first column.
The keywords must not appear inside a postblock.
The keywords cannot be nested. You can, however, have multiple sets of
unnested keywords.
If the keywords appear in comments (after the # symbol), MPBinX ignores them.
If the keywords do not occur in ordered, matched pairs, MPBinX ignores them.Please make sure to keep a backup of your post file!
-
13 hours ago, C^Millman said:
Jeff, our job as programmers is to make the work practical, predicable and repeatable to run day in and day out and yes MP is very powerful and yes it can do some amazing things, but none of that is going to help the companies he works for recoup all the time he puts into projects like this that from my experience cannot reap benefit. This is a case of someone before him that didn't do their job correctly and adding all of these checks and balances will never replace real world experience. There are 100's of way sometimes to machine a part and in this case it might serve this purposes, but what about the other 99 cases? Error checking anything is always 10X t o100X the original work of doing the process. A slippery slop is just that and when you get away from practical knowledge and trust some thing to always error proof something the problem is you don't learn what is the best way to get the job done. I can run it through this post that has the 500 questions to ask me things to check for mistakes. What happens when the 501th or the 657th error comes through? When does it becomes enough to check all the wrong things and not enough to just do it right the 1st time? When you spend 20 minutes answering all the questions on something that is programmed correctly would only take 2 minutes where is the value in always checking when if the correct process were done and trained then there wouldn't be an error to being with? That is the slippery slope when the process becomes to top heavy the supporting of it becomes so labor intensive it creates a lack of concern or care because well I don't have to do it right because the error checks will catch my mistakes.
I don't disagree, as you've seen my posts are as basic as it gets. I'm sharing information, not just for PcRobotic, but for any one that has the same question in the future.
-
My HASP is at the office, but I think you could set a flag to suppress the output. Set the flag by checking the total number of passes against the number of passes completed.
The total number of passes should be parameter 15560 + parameter 15380. You can track the number of passes completed by incrementing a counter at null tool change if the op_id$ is the same.
On night this week I'll bring my HASP home and work up an example.
- 1
-
Even if the question isn't practical, it shows how powerful MP is. There's not much you can't do in MP, especially when you consider that MP can call a hook and access Mastercam's API.
- 1
-
41773, but it's a new parameter for Mastercam 2018.
- 1
-
Are you using Mastercam 2017 or later? If so, you can use opinfo and do something like the below example in pheader$.
stoolPathComment = opinfo(15239, 0)
You'll have to initialize stoolPathComment somewhere in the post in order for the above line to work.
<LeftMargin>stoolPathComment : ""
I usually set up a post block that I call whenever I start a new op. The post your using probably has something comparable.
#region Tool Path Comment fmt "OP NUMBER - " 4 opNumber fmt "TOOLPATH MAX Z DEPTH: " 3 toolpathZMin stoolPathComment : "" pToolPathComment opNumber = opinfo(15240, 0) stoolPathComment = opinfo(15239, 0) toolpathZMin= opinfo(19, 0) n$, scommentStart, *opNumber, [if stoolPathComment <> sBlank, "|", stoolPathComment], scommentEnd e$ n$, scommentStart, *toolpathZMin, scommentEnd e$ #endregion End Tool Path Comment
Hope that helps,
Jeff
- 1
-
This is not an Agie vision machine. The New CUT series uses GF's new CUT 2 HMI and is closer to the Charmille side of the family.
Mastercam doesn't have a post that outputs a job (.mjb) file. However, if you are willing to do the sequencing at the machine you can use a post that generates a Charmille ISO file. That's how I did it when I worked for GF, but I was on the milling side of the family, so I didn't get much wire time.
Thanks,
Jeff
-
In hindsight, a better way would be to use the tt_op_id$ value as the 'key' for the line number in the stack.
#Start Array stackOpID : 0 stackLine : 0 #End Array pushResult : 0 fstack 1 2 ptooltable$ if (tt_count$ = TOOL_NOT_OUTPUT@), [ return = fprm(ONE@, OP_PARAMETERS@) toolDiameter = rparsngl(s1013, TWO@) stoolString = ucase(stoolString) n$, scommentStart, *tt_tool$, "|", *tt_tlngno$, "|", stoolString, "|", *toolDiameter, "|", pGetToolsMinimumZ(tt_tool$), no_spc$, scommentEnd e$ stackOpID = tt_op_id$ stackLine = tt_tlngno$ # This could be any value you'd like, it is now 'keyed' to the op_id$ value in the stack stackOPID = push(1, pushResult, 0) ]
We'd also have to make a slight change to our pGetLineNumber post block
#Start Array stackSize : 0 popResult : 0 #End Array #Start Array opID : 0 lineNumber : 0 #End Array currentOpID : 0 fmt "N" 4 lineNumber pGetLineNumber(currentOpID) # Pass the current op_id$ value to pGetLineNumber as an argument; pGetLineNumber(op_id$) stackSize = pop(1, popResult, 0) while (stackSize > 0), [ opID = pop(1, stackSize, 5) if (currentOpID = opID), [ stackSize = 0 *lineNumber, e$ ] else, stackSize = stackSize - 1 ]
- 1
-
1 hour ago, C^Millman said:
All ears and would love to see an example. Please point me to a Mastercam MP post that has been updated to use this?
I think this would work with some minor tweaks (depending on what you wanted the line numbers to be). In this example we'll make them the offset.
#region Tooltable s1013 : "" stoolString : "" fprmtbl 1 2 1013 s1013 10094 stoolString fmt "DIAMETER - " 3 toolDiameter fmt "MAX Z DEPTH: " 3 toolZMin fmt "TOOL NUMBER - " 4 tt_tool$ fmt "N" 4 tt_tlngno$ #Start Array stackTool : 0 stackLine : 0 #End Array pushResult : 0 fstack 1 2 ptooltable$ if (tt_count$ = TOOL_NOT_OUTPUT@), [ return = fprm(ONE@, OP_PARAMETERS@) toolDiameter = rparsngl(s1013, TWO@) stoolString = ucase(stoolString) n$, scommentStart, *tt_tool$, "|", *tt_tlngno$, "|", stoolString, "|", *toolDiameter, "|", pGetToolsMinimumZ(tt_tool$), no_spc$, scommentEnd e$ stackTool = tt_tool$ stackLine = tt_tlngno$ stackTool = push(1, pushResult, 0) ] opZMin : 0 tool : 0 toolIndex : 0 opToolNumber : 0 pGetToolsMinimumZ(tool) toolIndex = ZERO@ toolZMin = ZERO@ opToolNumber = opinfo(10002, toolIndex) while (opToolNumber <> QUERY_INVALID@), [ if (opToolNumber = tool), [ opZMin= opinfo(19, toolIndex) if (opZMin < toolZMin), [ toolZMin = opZMin ] ] toolIndex = toolIndex + ONE@ opToolNumber = opinfo(10002, toolIndex) ] *toolZMin #endregion End Tooltable
Once you have the tool numbers and the line numbers in the stack, you could use something like the below post block to write them out.
#Start Array stackSize : 0 popResult : 0 #End Array #Start Array toolNumber : 0 lineNumber : 0 #End Array fmt "N" 4 lineNumber matchFound : no$ pGetLineNumber matchFound = no$ stackSize = pop(1, popResult, 0) while (stackSize > 0), [ toolNumber = pop(1, stackSize, 5) if (t$ = toolNumber), matchFound = yes$ if (matchFound), [ stackSize = 0 *lineNumber, e$ ] else, stackSize = stackSize - 1 ]
This would need to be refined a bit to meet your goals. I'd be happy to talk more about solving this problem, send me an email if you'd like.
- 1
-
C^Millman,
If you move to the enhanced tool table your dependence on buffers will go down. Could even use a stack.
Thanks,
Jeff
-
Have you tried tox$, toy$ and toz$? They will give you the tool plane origin values.
in your case;
n$, <your rapid var>, *tox$, *toy$, e$
If you want the WCS origin values use t_orgin_x$, t_orgin_y$, and t_orgin_z$.
Jeff
-
The GFMS Mikron mills are slick.
I used to work for them in applications, so I may be biased.
-
- 1
-
param12207 is initialized the same way you would initialize any non-global variable in MP; "(left margin)param12207 : 0"
Try this;
- Open a new file and load your machine - DO NOT create any geometry
- Press the F9 key to display the axis lines
- Create a circle mill toolpath, and select the origin point for the geometry
- Under the toolpath's cut parameters, enter a diameter in the "Circle diameter" text box
- Post the file and see if the diameter entered in step 4 is present in the posted file.
- 1
- 1
-
-
There is no parameter number for that value.
However, you can estimate the total time in the post. Look at MIll2.set (installed with Mastercam) for an example of how to calculate the total time.
- 1
- 1
-
On 5/7/2018 at 11:53 PM, C^Millman said:
Thank you I appreciate your time and effort putting that up. Not your average user so mind sharing your back story?
I just like 'modern' MP, which is good because I do post support.
-
2 hours ago, C^Millman said:
Awesome got an example of doing this?
Yes, it's quite simple really.
First, find the initialization for tooltable$ and comment it out. Once commented out, replace it with x_tooltable$ and initialize it to 1
#tooltable$ : 3 #Removed, no longer needed with x_tooltable$ x_tooltable$ : 1 #
Next, find and comment out pwrtt$ and pwrttparam$. With the enhanced tool table they are no longer needed.
#pwrtt$ #Pre-read NCI file # if tool_info > 1 & t$ > 0 & gcode$ <> 1003, ptooltable #pwrttparam$ #Pre-read parameter data # #"pwrttparam", ~prmcode$, ~sparameter$, e$ # if prmcode$ = 15346, comp_type = rpar(sparameter$, 1) #Cutter compensation type - 0=computer, 1=control, 2=wear, 3=reverse wear, 4=off # if prmcode$ = 10010, xy_stock = rpar(sparameter$, 1) #Capture stock to leave (XY) # if prmcode$ = 10068, z_stock = rpar(sparameter$, 1) #Capture stock to leave (Z)
Now we need to merge the logic from pwrtt$ and pwrttparam$ into a new post block, ptooltable$.
So, before we had the ptooltable post block that was called from pwrtt$.
#ptooltable #Tooltable output # sopen_prn, *t$, sdelimiter, pstrtool, sdelimiter, *tlngno$, # [if comp_type > 0 & comp_type < 4, sdelimiter, *tloffno$, sdelimiter, *scomp_type, sdelimiter, *tldia$], # [if xy_stock <> 0 | z_stock <> 0, sdelimiter, *xy_stock, sdelimiter, *z_stock], # sclose_prn, e$ # xy_stock = 0 #Reset stock to leave values # z_stock = 0 #Reset stock to leave values
Now we have everything in the new post block, ptooltable$ (note the dollar sign)
ONE@ : 1 s1013 : "" fmt "TOOL DIA. - " 1 toolDiameter ptooltable$ if tt_count$ = ONE@, [ comp_type = opinfo(15346, 0) xy_stock = opinfo(10010, 0) z_stock = opinfo(10068, 0) s1013 = opinfo(1013, 0) toolDiameter = rparsngl(s1013, 2) sopen_prn, *tt_tool$, sdelimiter, pstrtool, sdelimiter, *tt_tlngno$, [if comp_type > 0 & comp_type < 4, sdelimiter, *tt_offset$, sdelimiter, *scomp_type, sdelimiter, *toolDiameter], [if xy_stock <> 0 | z_stock <> 0, sdelimiter, *xy_stock, sdelimiter, *z_stock], sclose_prn, e$ ]
We also have to change the pstrtool post block to use the new opinfo function.
stoolString : "" pstrtool stoolString = opinfo(10094, 0) if stoolString <> sblank, [ stoolString = ucase(stoolString) stoolString ]
What that done, we can call x_tooltable$ from any post block and start tool table processing.
- 1
-
If you are in 2017/2018/2019, you don't need a buffer to do this. The new tool table (x_tooltable$) can be called from any post block and is much more efficient than the old pwrtt$ method.
Implementing x_tooltable$ in your post may take some time, but it's a much faster way to access tool table data.
- 1
- 1
-
Updated post documentation is available, you should contact your Mastercam reseller.
- 1
z_min$, z_max$
in Post Processor Development Forum
Posted
Yes, this is much easier in 2017 and later. You should ask your reseller for information about 2017's enchanced tool table.