jeff.D

Verified Members
  • Content count

    152
  • Joined

  • Last visited

Community Reputation

79 Excellent

1 Follower

About jeff.D

  • Rank
    Member

Recent Profile Visitors

669 profile views
  1. Hi, I know nothing about the capabilities of the VB script dll. But, if you swapped over to a NET-Hook this is easily done with the EnumerateFiles method and Linq. var mastercamExtentions = new List<string> { ".MCAM-CONTROL", ".MCAM-MMD", ".MCAM-LMD", ".MCAM-RMD", ".MCAM-WMD", ".PST", ".PSB", ".PSM", ".MCPOST", ".MCBPOST", ".MCDPOST", ".MACHINE", ".MCAM" }; var allFiles = Directory .EnumerateFiles(folderPath, "*", SearchOption.AllDirectories) .Where(file => mastercamExtensions.Any(file.ToUpper().EndsWith)) .ToList(); You can read more about this here.
  2. Did you copy and paste that code from your editor? If so you have some extra junk after the 15332, see below. Once I removed the extra characters everything worked as expected.
  3. jeff.D

    4 Axis?!?

    The post linked to Mill Default (mpfan.pst) is a 4-axis post.
  4. The force operator (*) only works on variables, prdrlout is a postblock call. I'd use the force function on the variable that's in prdrlout before calling it.
  5. You can call a NET-Hook from the post and use the NET-Hook to interrogate the Mastercam file. If you wanted to use a system plane for this I think you could do it in the post without creating a extra toolpath, provided you are in 2017 or later (I realize that a system plane is limiting) .
  6. I don't think you need to use LN to support different axis combos; AC code in M128 will run on an BC machine. I think you mean TX, TY, and TZ for the tool vector.
  7. jeff.D

    Get Prmcode

    I think you're out of luck; that value doesn't appear to be written to a parameter.
  8. That makes sense. Under some circumstances (the enhanced tool table being one of them) populating a parameter table uses opinfo; so rather then typing opinfo a bunch of times, you can use a parameter table to minimize typing. The NCI line should be your last resort. The parameters are stored in a table and that makes it very quick to obtain the data. When you query an NCI line you are starting the the top of the file and reading every line until the data is found. On top of searching the NCI file, in most cases you need to parse the resulting string, adding more overhead to the process. Though it may work, -99999 is not "-99999" I'm surprised that they work. The enhanced tool table works much differently then pwrtt$ and I didn't expect it to write that data.
  9. Why write everything to buffer one? It would be much more efficient to handle all the output in the ptooltable$ post block. A few other notes that may be helpful... Using opinfo to query an NCI line should only be used as a last resort. This is because when opinfo is used to read an NCI line, it searches the NCI file rather then using the table built during the binary to text NCI conversion. #sparameter$ = opinfo(1013, 0) #b1_ToolDia = rparsngl(sparameter$, 2) #b1_ToolCornerRad = rparsngl(sparameter$, 3) #The ^^^ above ^^^ is slow, it's faster to use parameters when they are available. b1_ToolDia = opinfo(10005, 0) b1_ToolCornerRad = opinfo(10006, 0) The below comparison shouldn't work. When opinfo is used on parameters that are strings, it returns a string, even if the return is invalid. #if opinfo(20001, 0) <> -99999, s_ToolName = opinfo(20001, zero) # The ^^^ above ^^^ Should not work if opinfo(20001, 0) <> "-99999", s_ToolName = opinfo(20001, zero) For the same reason as described above, it's faster to use parameter 10094 as shown below. if opinfo(10094, 0) <> "-99999", s_ToolName = opinfo(10094, zero) I wouldn't expect zmin$ and zmax$ to be calculated during the enhanced tool table processing , it would be better to use parameters 16 and 19 as shown below. b1_Zmax = opinfo(16, 0) b1_Zmin = opinfo(19, 0) You can use tt_count$ to determine if a tool has been output ptooltable$ if tt_count$ = 1, [ result = fprm(101, zero) sopen_prn, *tt_tool$, sdelimiter, ptool_name, sdelimiter, *tt_tlngno$, [if comp_type > 0 & comp_type < 4, sdelimiter, *tt_offset$, sdelimiter, *scomp_type, sdelimiter, *tool_dia], [if not(drilling_op), pget_stock_to_leave_tt(tt_tool$)], sdelimiter, pget_tool_z_min(tt_tool$), sclose_prn, e$ ] Rather than using opinfo multiple times, consider using a parameter table and populating it with fprm. # Enhanced Tool Table Parameters fprmtbl 101 2 #Table Number, Size # Param Variable to load value into 10005 tool_dia 15346 comp_type Hope that helps!
  10. If you use Mastercam 2017 or later, there is a much better (easier/cleaner/faster) way to do this. I would recommend you explore the new options CNC Software has introduced before implementing the code snippet in this thread.
  11. jeff.D

    mastercam 9.1 w/ GRBL

    The below ran on grbl 1.1. I think you'll need a G49 to cancel the G43.1, but I'm only hooked up to the board so I can't tell too much G0 G53 Z0. M01 G0 G90 G54 X-1. Y.5 S5000 M3 G43.1 Z.51 G1 Z.23 F50. X1. F350. Y-.5 X-1. Y.5 Z.49 F300. M5 G0 G53 Z0. G0 G53 X0. Y0. M30 % I
  12. jeff.D

    mastercam 9.1 w/ GRBL

    I think the best way to disable the tool change is to use the auxiliary file stream and generate a new file for each tool. I have an example of this but I'm not sure if it will work in V9. If I have time tonight I'll flash grbl and see if I can get out put that works.
  13. jeff.D

    mastercam 9.1 w/ GRBL

    The GitHub makes it seem like a Fanuc post with a few tweaks would do the trick, do you have a Fanuc post you could try? List of Supported G-Codes in Grbl v0.9 Master: - Non-Modal Commands: G4, G10L2, G10L20, G28, G30, G28.1, G30.1, G53, G92, G92.1 - Motion Modes: G0, G1, G2, G3, G38.2, G38.3, G38.4, G38.5, G80 - Feed Rate Modes: G93, G94 - Unit Modes: G20, G21 - Distance Modes: G90, G91 - Arc IJK Distance Modes: G91.1 - Plane Select Modes: G17, G18, G19 - Tool Length Offset Modes: G43.1, G49 - Cutter Compensation Modes: G40 - Coordinate System Modes: G54, G55, G56, G57, G58, G59 - Control Modes: G61 - Program Flow: M0, M1, M2, M30* - Coolant Control: M7*, M8, M9 - Spindle Control: M3, M4, M5 - Valid Non-Command Words: F, I, J, K, L, N, P, R, S, T, X, Y, Z
  14. Quite a few of CNC's posts have the logic in them, download MPFAN from the tech exchange and have a look. If that doesn't help, contact your Mastercam reseller, there's documentation available.
  15. jeff.D

    Hotkey Rechain All?

    Have a look at the documentation, project examples, and SDK fourm to start with. If you get stuck, your reseller should be able to open a support ticket for SDK issues on your behalf.

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