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:

Zaffin_D

Verified Members
  • Posts

    374
  • Joined

  • Days Won

    1

Everything posted by Zaffin_D

  1. Thanks, but you didn't have to bother; I got the jist of it from you're first project.
  2. 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$
  3. I downloaded the repo, thanks for the example. This is likely the same approach I intended on taking. Native code compiled to a static library, then a CLR wrapper dll for use with .NET.
  4. I want to use unmanaged code in a NET-Hook. I'm interested in what you've done; do you have a GitHub?
  5. 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$
  6. As others have said, you'll need a C-Hook to import wire or Lathe operations. I've wanted to create an interop C-Hook for these commonly used functions (Import, calculating cycle time, etc.) but I haven't had the time.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. If you post this on the official Mastercam forums you may get an answer from CNC Software's SDK team.
  13. NET-Hook's have all but replaced VBScript, the NET-Hook docs are available here.
  14. Hello, The parameter is correct. I think your issue is that you are not rounding the values to their respective formats before the comparison.
  15. 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.
  16. 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 .
  17. 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.
  18. 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.
  19. I don't think you'll be able to gather that information while posting.
  20. 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.

Follow us

×
×
  • Create New...