Zaffin_D
Verified Members-
Posts
374 -
Joined
-
Days Won
1
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Everything posted by Zaffin_D
-
MP has a round( ) function, but I don't see any way to ensure you're always rounding up. There is also the rounding method in the format statement, but based on the definition below I don't think it will help you Rounding method. Use the following values: (omitted) - Normal rounding. 2 - Round final decimal to nearest even number. 5 - Round final decimal to nearest multiple of 5. 9 - Truncate the decimal portion of the value at the specified number of digits. Below is an example that should round the passed in value up (or down), but I can't test it. Maybe it will help you. UP@ : 1 DOWN@ : 2 ERROR@ : -99999 value : 0 type : UP@ int_value : 0 frac_value : 0 #//The first argument is being passed by reference '!' #//'type' is initialized to UP@(1) and set to UP@(1) at the end of 'pround' #//Because of this, we can consider 'type' optional pround(!value, type) #//Get the integer portion of the passed in value int_value = int(value) #//Get the fractional portion of the passed in value #//The fractional portion is not used in this example frac_value = frac(value) if type = UP@, [ value = int_value + 1 ] if type = DOWN@, [ value = abs_value ] else, [ value = ERROR@ ] type = UP@ #//Calling example #//Output (depending on format) -> #// x_abs is : 4.75342 #// x_abs rounded up is : 5 #// x_abs rounded down is: 4 #// #// x_abs rounded up is : 5 x_abs : 0 y_abs : 0 z_abs : 0 pany_postblock x$ = 4.75342 x_abs = vequ(x$) "x_abs is :", *x_abs, e$ pround(!x_abs, UP@) "x_abs rounded up is :", *x_abs, e$ x_abs = vequ(x$) pround(!x_abs, DOWN@) "x_abs rounded down is:", *x_abs, e$ *e$ #//The 'type' argument is optional x_abs = vequ(x$) pround(!x_abs) "x_abs rounded up is :", *x_abs, e$
-
Quotation mark in comment string
Zaffin_D replied to cncah's topic in Post Processor Development Forum
sdq : '"' fmt "Inches: " 4 inches sdq #// Output -> Inches: 12" (Depending on format) pany_postblock inches = 12 *inches, e$ or sstring : "" #// Output -> Inches-> " pany_postblock sstring = "Inches-> " + '"' sstring, e$ -
It seems that the latest CNC post handle this a bit differently. Below is a postblock from the Techno Titan that was recently uploaded to the tech exchange. ptool_name #Comment for tool stool_name = opinfo(10094, zero) if stool_name <> sblank | stool_name <> squery_invalid, [ stool_name = regex("^\s+", sblank, two) #Remove leading whitespace stool_name = ucase(stool_name) *stool_name ] It might be worth adding it to your post and seeing if it works differently than pstrtool. It's also worth noting that the Techno post in the link appers to be using much of the new post technology introduced in Mastercam 2017.
-
Parameter# for TRANSFORM OPERATION PARAMETERS
Zaffin_D replied to PcRobotic's topic in Post Processor Development Forum
I'm not 100% sure these will work in 2020, I recall having some issues gathering information from transform ops. 15870 -> Are misc. ops on 15774-15777 -> Custom integers 1-4 15778-15781 -> Custom reals 1-4 You should also reach out to your reseller and request the 2020 post docs. They are now in a html format rather than the .pdf; I find the new format much easier to work with. -
Ah! you are using the enhanced tool table! I can't reproduce this issue, so I'd need to see the whole post. I do see a few things in the code you posted that I don't like, but nothing that would be causing your issue. I'd kick it up to you're reseller, they'll be able to sort you out.
-
Without seeing the post, I'll take a stab in the dark and say that you're using strtool$ to output the tool description. Assuming that I'm correct, this is due to how the legacy tool table processing in MP works; many predefined variables get populated during the tool table processing, including strtool$. As for a fix, I won't be much help. I've moved on from the legacy tool table and I've forgotten the little I knew about it.
-
What version of Mastercam are you using?
-
Resources error?
Zaffin_D replied to DeerSausage's topic in Mastercam C-Hook, NET-Hook and VBScript Development
Judging by the error message I'd say the dnRES_NAME in the .ft is not set correctly. dnRES_NAME should point to the .resx file in the Resources folder as shown below. I highly encourage you to create an account on the official Mastercam forums so you'll have access to the NET-Hook documentation. -
Resources error?
Zaffin_D replied to DeerSausage's topic in Mastercam C-Hook, NET-Hook and VBScript Development
If you post this on the official Mastercam forums you may get an answer from CNC Software's SDK team. -
NET-Hook's have all but replaced VBScript, the NET-Hook docs are available here.
-
Hello, The parameter is correct. I think your issue is that you are not rounding the values to their respective formats before the comparison.
-
Adding Haas macro variables into tool table
Zaffin_D replied to rmarshall5's topic in Post Processor Development Forum
Your local reseller should be your first stop for all things Mastercam, including posts. If your reseller doesn't know the answer, they can open a ticket with CNC Software.- 7 replies
-
- 1
-
- haas
- post processor
-
(and 3 more)
Tagged with:
-
Adding Haas macro variables into tool table
Zaffin_D replied to rmarshall5's topic in Post Processor Development Forum
Did you contact your Mastercam reseller about this?- 7 replies
-
- haas
- post processor
-
(and 3 more)
Tagged with:
-
I realized after posting that updating op_id$ in null tool change will not work. is_new_op = fsg(op_id$ <> prv_op_id$, yes$, no$) ptlchg0$ if is_new_op, "M01", e$ ptlchg$ !op_id$ Depending on how your post is setup you may have to change w h en op_id$ is updated with the '!' modifier .
-
The op_id$ value is the key to this. op_id$ is the unique identifier for an operation in the Mastercam database. There is more than one way to do this. I typically set up a boolean constant called is_new_op that checks the value of op_id$ to the prv_op_id$. Then in the null tool change postblock I use is_new_op to determine whether or not to output the op stop code. Some pseudo code below is_new_op = fsg(op_id$ <> prv_op_id$, yes$, no$) ptlchg0$ if is_new_op, "M01", e$ !op_id$ Depending on how your post is setup you may have to change when op_id$ is updated with the '!' modifier.
-
Post location on MC site
Zaffin_D replied to So not a Guru's topic in Post Processor Development Forum
Mastercam Tech Exchange. -
Posting at 180 deg rotation
Zaffin_D replied to bigprody's topic in Post Processor Development Forum
Care to provide some pseudo code? I think I understand what you want, but I'm unsure what the nc would look like. Once I have an example I'll create some examples. -
MasterCam2020 chain ID call out
Zaffin_D replied to PcRobotic's topic in Post Processor Development Forum
I don't think you'll be able to gather that information while posting. -
A .mcam-content file is a .zip archive containing files in the Mastercam folder structure. If you drag a .mcam-content onto Mastercam (or double click it) it will unzip and copy the files to the corresponding Mastercam directories automatically. If you are a power user, change the extension to .zip and place the files manually.
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.