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:

Lee1

Verified Members
  • Posts

    71
  • Joined

  • Last visited

Posts posted by Lee1

  1. 12 hours ago, Roger Martin from CNC Software said:

    Could we get a bit more information here? Any errors? 

    What are the specific types of the toolpath operation you are trying to .Commit?

     

    no any error,all operation nci name are same last group name, I want rename operation nci by group name

    Toolpath Group-1  nci name Toolpath Group-1.nci

    Toolpath Group-2  nci name Toolpath Group-2.nci

    Toolpath Group-3  nci name Toolpath Group-3.nci

    Toolpath Group-4  nci name Toolpath Group-4.nci

    ..etc.

    thanks

  2. vb.net 2008 X5

    how can i do rename nciname by toolgroup name,below code run fail,thanks

     

              For Each groups As Mastercam.Support.Group In Mastercam.Support.SearchManager.GetGroups()

                   For Each op_s As Mastercam.Database.Operation In SearchManager.GetOperations
                       op_s.NCIName = group_name & Str(intCount) & ".NCI"
                        op_s.Commit()
                        If (op_s.Dirty) Then
                            op_s.Regenerate()
                        End If
                   Next
                   intCount = intCount + 1
               Next

  3. On 2017/5/16 at 8:23 AM, Mick George said:

    There is no SDK install required for .NET NET-Hooks, just add a reference to the NETHook DLL located in your Mastercam install folder. As for templates, I never created one for VS2008.

     

    I would install the free VS 2017 Community Edition which is essentially a Professional Edition and will be more than adequate for NET-Hooks. If you do and when you create a new Vb.NET NET-Hook project just remove the existing NET-Hook DLL reference from the project and add a new reference pointing to your Mastercam X5 location.

    vb.net 2008

    rename select operation  nci name by tool number , i can count select operation number, but rename nci name fail, how can i do it rename operation nci name buy tool number.

     below is my .net code

         Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

      Dim intCount As Integer
            intCount = 0

            For Each op As Mastercam.Database.Operation In SearchManager.GetOperations(True)
                intCount = intCount + 1
                op.NCIName = Microsoft.VisualBasic.ChrW(op.OperationTool.Number)

            Next

    DialogManager.OK("Count Select Operation Number:" & CStr(intCount) , "Information")

    End Sub

  4. see below source code

     

    # --------------------------------------------------------------------------
    # Common User-defined Variable Initializations (not switches!)
    # --------------------------------------------------------------------------
    #Format assignment for absolute/incremental variables
    fmt  "X" 2  xabs        #X position absolute
    fmt  "Y" 2  yabs        #Y position absolute
    fmt  "Z" 2  zabs        #Z position absolute
    fmt  "X" 3  xinc        #X position incremental
    fmt  "Y" 3  yinc        #Y position incremental
    fmt  "Z" 3  zinc        #Z position incremental
    fmt  "A" 20 p_abs       #Primary absolute axis position
    fmt  "B" 20 s_abs       #Secondary absolute axis position
    fmt  "C" 20 d_abs       #Dummy absolute axis position
    fmt  "A" 21 p_inc       #Primary incremental axis position
    fmt  "B" 21 s_inc       #Secondary incremental axis position
    fmt  "C" 21 d_inc       #Dummy incremental axis position

    #Global assignment for output variables
    xout = xabs
    yout = yabs
    zout = zabs
    prv_xout = prv_xabs
    prv_yout = prv_yabs
    prv_zout = prv_zabs
    p_out = p_abs
    s_out = s_abs
    d_out = d_abs
    prv_p_out = prv_p_abs
    prv_s_out = prv_s_abs
    prv_d_out = prv_d_abs

    p_absinc_chng   #Set global assignment to the output variable
          if prv_absinc$ <> absinc$,
            [
            if absinc$,
              [
              #Incremental linear output
              result = newfs(three, xout)
              result = updgbl(xout, "xinc")
              result = updgbl(prv_xout, "prv_xinc")
              result = newfs(three, yout)
              result = updgbl(yout, "yinc")
              result = updgbl(prv_yout, "prv_yinc")
              result = newfs(three, zout)
              result = updgbl(zout, "zinc")
              result = updgbl(prv_zout, "prv_zinc")
              #Incremental rotary output, always absolute for signed
              if not(pang_output),
                [
                result = newfs(21, p_out)
                result = updgbl(p_out, "p_inc")
                result = updgbl(prv_p_out, "prv_p_inc")
                ]
              if not(sang_output),
                [
                result = newfs(21, s_out)
                result = updgbl(s_out, "s_inc")
                result = updgbl(prv_s_out, "prv_s_inc")
                ]
              ]
            else,
              [
              #Absolute linear output
              result = newfs(two, xout)
              result = updgbl(xout, "xabs")
              result = updgbl(prv_xout, "prv_xabs")
              result = newfs(two, yout)
              result = updgbl(yout, "yabs")
              result = updgbl(prv_yout, "prv_yabs")
              result = newfs(two, zout)
              result = updgbl(zout, "zabs")
              result = updgbl(prv_zout, "prv_zabs")
              #Absolute rotary output
              result = newfs(20, p_out)
              result = updgbl(p_out, "p_abs")
              result = updgbl(prv_p_out, "prv_p_abs")
              result = newfs(20, s_out)
              result = updgbl(s_out, "s_abs")
              result = updgbl(prv_s_out, "prv_s_abs")
              ]
            ]

     

     

     

     

     

     

     

     

     

     

     

     

    # --------------------------------------------------------------------------
    # Position calculations, generally these do not need to be modified
    # --------------------------------------------------------------------------
    #Incremental calculations
    ps_inc_calc     #Incremental calculations and output assignment, start             
          xabs = fmtrnd(xa)
          yabs = fmtrnd(ya)
          zabs = fmtrnd(za)
          xinc = vsub (xabs, prv_xabs)
          if drilltype = two,
            [
            if gcode$ = 81, pdrillcalc81
            if absinc$,
              [
              refhtoutx = vsub(drl_rxa, xabs)
              drlx = vsub(drl_dxa, xabs)
              ]
            else,
              [
              refhtoutx = vequ(drl_rxa)
              drlx = vequ(drl_dxa)
              ]
            ]
          ps_cinc_calc
          p_absinc_chng

    ps_cinc_calc    #Incremental calculations, start rotary             
          @p_abs, @s_abs
          p_inc = vsub (p_abs, prv_p_abs)

    pe_inc_calc     #Incremental calculations, end             
          if cuttype = one, x$ = xnci$, y$ = ynci$, z$ = znci$
          !x$, !y$, !z$, !xabs, !xinc, !yabs, !yinc, !zabs, !zinc
          !p_abs, !p_inc, !s_abs, !s_inc, !fr_pos$
          !cc_pos$, !cutpos2$    # 01/26/04

    p_absinc_chng   #Set global assignment to the output variable
          if prv_absinc$ <> absinc$,
            [
            if absinc$,
              [
              #Incremental linear output
              result = newfs(three, xout)
              result = updgbl(xout, "xinc")
              result = updgbl(prv_xout, "prv_xinc")
              result = newfs(three, yout)
              result = updgbl(yout, "yinc")
              result = updgbl(prv_yout, "prv_yinc")
              result = newfs(three, zout)
              result = updgbl(zout, "zinc")
              result = updgbl(prv_zout, "prv_zinc")
              #Incremental rotary output, always absolute for signed
              if not(pang_output),
                [
                result = newfs(21, p_out)
                result = updgbl(p_out, "p_inc")
                result = updgbl(prv_p_out, "prv_p_inc")
                ]
              if not(sang_output),
                [
                result = newfs(21, s_out)
                result = updgbl(s_out, "s_inc")
                result = updgbl(prv_s_out, "prv_s_inc")
                ]
              ]
            else,
              [
              #Absolute linear output
              result = newfs(two, xout)
              result = updgbl(xout, "xabs")
              result = updgbl(prv_xout, "prv_xabs")
              result = newfs(two, yout)
              result = updgbl(yout, "yabs")
              result = updgbl(prv_yout, "prv_yabs")
              result = newfs(two, zout)
              result = updgbl(zout, "zabs")
              result = updgbl(prv_zout, "prv_zabs")
              #Absolute rotary output
              result = newfs(20, p_out)
              result = updgbl(p_out, "p_abs")
              result = updgbl(prv_p_out, "prv_p_abs")
              result = newfs(20, s_out)
              result = updgbl(s_out, "s_abs")
              result = updgbl(prv_s_out, "prv_s_abs")
              ]
            ]

     

     

    pupd_brk        #Update the current position/angle to store in prv_ for last pos
          !brk_gcode
          prv_brk_xa = vequ(brk_xa)
          prv_brk_ua = vequ(brk_ua)
          prv_brk_vecx = vequ(brk_vecx)
          prv_brk_iout = vequ(brk_iout)
          prv_brk_drl_rxa = vequ(brk_drl_rxa)
          prv_brk_drl_dxa = vequ(brk_drl_dxa)
          prv_brk_drl_zxa = vequ(brk_drl_zxa)
          prv_brk_drl_txa = vequ(brk_drl_txa)
          prv_brk_p_abs = vequ(brk_p_abs)

          #These are separate from the break routine
          prv_brk_p_wnd_ang = vequ(brk_p_wnd_ang)
          !p_wnd_ang
          !s_wnd_ang
          !p_lim_flg
          !s_lim_flg
          !drilltype
          !pln_match

     

     

    #Rotate vecx, the machine base vector for angle calculations
    pp_rot_vecx     #Rotate vecx to primary angle
          if axis_rot1 = one | axis_rot1 = three, axisx$ = vequ(caxisx)
          else,
            [
            if axis_rot1 = two | axis_rot1 = six, axisx$ = vequ(baxisx)
            else, axisx$ = vequ(aaxisx)
            ]
          if mtype > two, #Nutator, undo the rotation, p_abs is output angle
            [
            if p_sign_ang > zero,
              p_vec_rot = -p_sign_ang*p_abs+p_shft_ang
            else,
              p_vec_rot = -p_sign_ang*p_abs-p_shft_ang
            ]
          else, p_vec_rot = p_sign_ang*p_abs+p_shft_ang

          if (pri_vert), p_vec_rot = p_sign_ang*p_abs
          vecx = rotv(p_vec_rot, vecx)

    ps_rot_vecx     #Rotate vecx to secondary angle
          if mtype < three, #Non nutator
            [
            if axis_rot2 = one | axis_rot2 = three, axisx$ = vequ(caxisx)
            else,
              [
              if axis_rot2 = two | axis_rot2 = six, axisx$ = vequ(baxisx)
              else, axisx$ = vequ(aaxisx)
              ]
            ]
          else, axisx$ = vequ(nut_vecx)

          s_vec_rot = s_sign_ang*s_abs+s_shft_ang

          if mtype > two & nut_ang_pri$ < zero, s_vec_rot = -s_vec_rot

          vecx = rotv(s_vec_rot, vecx)

  5. It is where the buffer is being called. Need to make sure you make the call before any code is processed. That writes it and since the tooltable is at the start it really only meant to process tools and not all the code the process has to be redo to process the whole operation then store it to then call it. That is the thing about buffers I never get.

     

    thanks you reply.

    how can i do my want result?

  6. The first tool value is -9999/9999.the other tool value is ok.

     

    see below red color is error value

     

    (T4 - 3.00 90 DEG FACEMILL - H4 - D4 - D3.0000"Z99999.Z-99999.)

    (T5 - 1.000 ROUGH EM W/.03 - H5 - D5 - D1.0000" - R0.0300"Z3.6018Z4.5)

    (T6 - 1.000 E/MILL 2-3FL. .03 - H6 - D6 - D1.0000" - R0.0300"Z-1.8Z4.5)

    (T1 - D2.0 90° FACEMILL - H1 - D1 - D2.0000" - R0.0300"Z2.1978Z4.5)

    (T9 - .750 FINISH EM W/.03 - H9 - D9 - D0.7500" - R0.0300"Z2.0478Z4.5)

    (T8 - .50 FINISH EM W/.03 - H8 - D8 - D0.5000" - R0.0300"Z1.5Z4.5)

    (T7 - .50 FINISH EM W/.03 - H7 - D7 - D0.5000" - R0.0300"Z-1.0913Z1.2585)

    (T11 - 0.5 CARBIDE ENDMILL W./R.019 - H11 - D11 - D0.5000" - R0.1900"Z.4756Z4.5)

    (T10 - 3/8" NC SPOT DRILL 3.0" OOH 7.6" MIN GAGE - H10 - D10 - D0.3750"Z-1.51Z4.5)

    (T12 - 0.18 DRILL - H12 - D12 - D0.1800"Z-1.68Z4.5)

    (T16 - 0.188 PRE-BORING - H16 - D16 - D0.1880"Z-1.828Z4.5)

    (T17 - 0.196 REAMER - H17 - D17 - D0.1960"Z-1.658Z4.5)

    (T13 - 7/16 DRILL - H13 - D13 - D0.4375"Z-.2493Z4.5)

    (T14 - .615 PRE-BORING - H14 - D14 - D0.6150"Z-.03Z4.5)

    (T15 - 0.625 REAMER - H15 - D15 - D0.6250"Z-.03Z4.5)

     

    below is code

     

    ptooltable # Write tool table, scans entire file, null tools are negative

    tnote = t$

    toffnote = tloffno$

    tlngnote = tlngno$

    spaces$=0

    if t$ >= zero,

    [

    preadbuf1

    if tcr$>0, scomm_str, *t$, ptspace, " - ", plistcomm, " - ", *tlngno$, phspace, " - ", *tloffno$, pdspace, " - ", *tldia$, punit, pdiamspc, " - ", *tcr$, punit, min_depth, max_depth, scomm_end, e$

    if tcr$=0, scomm_str, *t$, ptspace, " - ", plistcomm, " - ", *tlngno$, phspace, " - ", *tloffno$, pdspace, " - ", *tldia$, punit, pdiamspc, min_depth, max_depth, scomm_end, e$

    ]

    pwritbuf1 # Write Buffer 1

    b1_gcode = gcode$

    if gcode$ = 1000 & op_id$ <> prv_op_id$ & list_type = 0, b1_gcode = 1002

    #if gcode = 1002 & op_id = prv_op_id, b1_gcode = 1000 #V9.12

    if gcode$ = 1002 & abs(t$) = prv_t$ & list_type = 1, b1_gcode = 1000

    prv_t$ = abs(t$)

    !op_id$

    last_op_id = op_id$

    b1_xmin = x_min$

    b1_xmax = x_max$

    b1_ymin = y_min$

    b1_ymax = y_max$

    b1_zmin = z_min$

    b1_zmax = z_max$

    b1_gcode = wbuf(1, wc1)

    preadbuf1 # Read Buffer 1

    size1 = rbuf(1,0)

    b1_gcode = 1000

    min_depth = 99999

    max_depth = -99999

    while rc1 <= size1 & b1_gcode = 1000, preadbuf1_1

    preadbuf1_1 # Read Buffer 1

    if rc1 <= size1, b1_gcode = rbuf(1,rc1)

    if b1_zmin < min_depth, min_depth = b1_zmin

    if b1_zmax > max_depth, max_depth = b1_zmax

    • Like 1
  7. Im no post guru, but if one is building a string, dont you have to ADD the newest string to the existing string?

     

    example:

    svbsfile = "Sub Main" # svbsfile ="Sub Main"

    svbsfile = "End Sub" # svbsfile="End Sub" now, NOT both lines... ("Sub Main" is overwritten).

     

    so it LOOKS like your vbs file contains ONLY wbuf (2,15) .....

     

     

    The vb script file is no problem.

     

     

     

    below is PST Code

    ---------------------------------------------------------------------------------------------------------------------------------------

    ---------------------------------------------------------------------------------------------------------------------------------------

     

     

    [post_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V15.00 P0 E1 W15.00 T1305895878 M15.00 I0 O0

     

    # Post Name : MPFAN.pst

     

    # Product : Mill

     

    # Machine Name : Generic

     

    # Control Name : Fanuc

     

    # Description : Generic 4 Axis Mill Post

     

    # 4-axis/Axis subs. : Yes

     

    # 5-axis : No

     

    # Subprograms : Yes

     

    # Executable : MP 15.0

     

    #

     

    # WARNING: THIS POST IS GENERIC AND IS INTENDED FOR MODIFICATION TO

     

    # THE MACHINE TOOL REQUIREMENTS AND PERSONAL PREFERENCE.

     

    #

     

    # THIS POST REQUIRES A VALID 3 OR 4 AXIS MACHINE DEFINITION.

     

    # YOU WILL RECEIVE AN ERROR MESSAGE IF MORE THAN ONE ROTARY AXIS IS DETECTED IN

     

    # THE ACTIVE AXIS COMBINATION WITH READ_MD SET TO YES.

     

    #

     

    # Associated File List$

     

    #

     

    # Associated File List$

     

    #

     

    # --------------------------------------------------------------------------

     

    # Revision log:

     

    # --------------------------------------------------------------------------

     

    # CNC 06/09/05 - Initial post setup for Mastercam X

     

    # CNC 10/06/05 - Changed parameter read for min_speed, modified pspindle, pprep$ and pset_mach

     

    # - Modified pset_rot_label to use srot_y for horizontal machines

     

    # - Added call to pset_mach in pq$ to set rotaxtyp$

     

    # CNC 11/18/05 - Added psynclath with call to pset_mach to set rotaxtyp$, removed call from pq$

     

    # CNC 02/03/06 - Added logic for high-speed toolpath tool inspection (see prapidout & plinout)

     

    # CNC 06/26/06 - Initial post setup for Mastercam X2

     

    # CNC 12/15/06 - Modified pset_mach for horizontal rotation when rotating about world Z axis.

     

    # CNC 02/26/07 - Modified pwcs

     

    # CNC 11/02/07 - Added prv_shftdrl$ = zero

     

    # CNC 04/08/08 - X3 release - Removed check for write_ops

     

    # CNC 01/26/09 - Initial post update for Mastercam X4

     

    # CNC 04/15/09 - Added read_md switch to enable or disable setting rotary axis from Machine Definition

     

    # CNC 05/06/09 - Modified pindxcalc to omit ctable check when rotary is not indexer

     

    # CNC 06/09/09 - Updated MD parameters

     

    # CNC 08/31/09 - Added check for read_md in pset_mach

     

    # CNC 02/03/10 - Initial post update for Mastercam X5

     

    # CNC 04/21/10 - Added Toolpath Transform Enhancements

     

    # CNC 08/17/10 - Added fix for canned drill cycle incremental mode code output and Z output in incremental mode

     

    # - Added fix for X coolant output

     

    # - Added fix for MP line break pattern

     

    # - Added fix for stock to leave output in tool table

     

    # - Removed CD_VAR variables

     

    # - Added axis sub direction logic

     

    # CNC 08/23/10 - Added logic to handle axis sub with signed or shortest direction and rotation >= 360 degrees

     

    # CNC 02/17/11 - Added three arctype$ initialization variables that are used for

     

    # full arc and helix arc output, when CD is set to R or signed R

     

    # CNC 05/20/11 - Initial post update for Mastercam X6

     

    # CNC 05/23/11 - Modified pcoutrev to fix potential endless loop when processing axis sub

     

    # CNC 09/01/11 - Modified pcoutrev to fix potential endless loop when processing axis sub for null tool change operation

     

    # CNC 11/21/11 - Modified ptap$ and pmisc2$ logic. Post now uses switch (tap_feedtype) to control

     

    # Feed per Unit (Inch/MM), or Feed per Revolution

     

    # CNC 12/28/11 - Minor spacing change

     

    #

     

    # --------------------------------------------------------------------------

     

    # Features:

     

    # --------------------------------------------------------------------------

     

    # This post supports Generic Fanuc code for 3 and 4 axis milling.

     

    # It is designed to support the features of Mastercam X Mill.

     

    #

     

    # NEW FEATURES FOR X:

     

    # - Machine definition, control definition and toolpath group parameter read sections added.

     

    # - Post sets rotary "switches" from MD and CD settings. Also sets min/max spindle speed,

     

    # max feed rates and type of feed for rotary motion from MD and CD. Includes option for

     

    # units/min and units/sec for inverse time feed rate.

     

    # - Variable initialization with SET_BY_MD or SET_BY_CD are overwritten in this post by parameter or

     

    # variable settings from MD or CD.

     

    # - Support for rotary axis lock/unlock codes when in index mode (see rot_lock)

     

    # - Support for signed rotary axis direction and M-code specified axis direction (see use_rotmcode)

     

    # - Switch to force rotary output to index mode when tool plane positioning with a full rotary (see force_index)

     

    # - Enhanced tool information - Added switch for tool comments only, tooltable in header with no tool

     

    # comments at tool change or tooltable in header with tool comments at tool change (see tool_info)

     

    # Tooltable output includes cutter compensation type and stock to leave information

     

    # - Enhanced tool staging options - enable or disable in CD. Set stagetltype in post for output type:

     

    # Do not stage 1st tool, stage 1st tool at last tool change or stage 1st tool at end of file (peof)

     

    # - Supports X comments including machine name, group name and group comment output (see pcomment2)

     

    # - Additional date, time and data path output options (see pheader)

     

    # - Additional rigid tapping cycle (separate from original tapping cycle) and initial custom drill

     

    # cycle support (see pmisc2$ and pdrlcst$)

     

    # - Support for 10 additional canned text options for X

     

    # - Decimal support for sequence number output (set "Increment sequence number" in CD to a decimal value

     

    # for output. I.E. "Increment sequence number" = .5, "Start sequence number" = 10 : N10, N10.5, N11, N11.5, etc...)

     

    # - Switch for output of M00 or M01 at tool change (3 position switch, off, M00, M01 - see prog_stop)

     

    # - Support for seperate XY, XZ and YZ plane/arc variables (see Arc page in CD)

     

    # - Support for X style coolant. Allows up to 10 different coolants to be turned on/off before, with, or after like

     

    # canned text. Coolant output is handled by "coolant" variable and string selector for V9 style coolant,

     

    # "coolantx" variable and string selector for X style coolant.

     

    #

     

    # --------------------------------------------------------------------------

     

    # Misc. Values:

     

    # --------------------------------------------------------------------------

     

    # Integers:

     

    #

     

    # mi1 - Work coordinate system

     

    # 0 = Reference return is generated and G92 with the

     

    # X, Y and Z home positions at file head.

     

    # 1 = Reference return is generated and G92 with the

     

    # X, Y and Z home positions at each tool.

     

    # 2 = WCS of G54, G55.... based on Mastercam settings.

     

    #

     

    # mi2 - Absolute or Incremental positioning at top level

     

    # 0 = absolute

     

    # 1 = incremental

     

    #

     

    # mi3 - Select G28 or G30 reference point return.

     

    # 0 = G28, 1 = G30

     

    #

     

    # mi4 - mi10 (NOT USED)

     

    #

     

    # Reals:

     

    #

     

    # mr1 - mr10 (NOT USED)

     

    #

     

    # --------------------------------------------------------------------------

     

    #Canned text:

     

    # Entering cantext on a contour point from within Mastercam allows the

     

    # following functions to enable/disable.

     

    # Cantext value:

     

    # 1 = Program Stop = output the "M00" stop code

     

    # 2 = Optional Stop = output the "M01" optional stop code

     

    # 3 = Block Delete on = turn on block delete codes in NC lines

     

    # 4 = Block Delete off = turn off block delete codes in NC lines

     

    #

     

    # --------------------------------------------------------------------------

     

    #Milling toolpaths (4 axis)

     

    #Layout:

     

    # The term "Reference View" refers to the coordinate system associated

     

    # with the Top view (Alt-F9, the upper gnomon of the three displayed).

     

    # Create the part drawing with the axis of rotation about the axis

     

    # of the "Reference View" according to the setting you entered for

     

    # 'vmc' (vertical or horizontal) and 'rot_on_x' (machine relative

     

    # axis of rotation).

     

    # vmc = 1 (vertical machine) uses the top toolplane as the base machine

     

    # view.

     

    # vmc = 0 (horizontal machine) uses the front toolplane as the base machine

     

    # view.

     

    # Relative to the machine matrix -

     

    # Rotation zero position is on the Z axis for rotation on X axis.

     

    # Rotation zero position is on the Z axis for rotation on Y axis.

     

    # Rotation zero position is on the X axis for rotation on Z axis.

     

    # The machine view rotated about the selected axis as a "single axis

     

    # rotation" are the only legal views for 4 axis milling. Rotation

     

    # direction around the part is positive in the CCW direction when

     

    # viewed from the plus direction of the rotating axis. Set the variable

     

    # 'rot_ccw_pos' to indicate the signed direction. Always set the work

     

    # origin at the center of rotation.

     

    #

     

    #Toolplane Positioning:

     

    # Create the Cplane and Tplane as the rotation of the machine view about

     

    # the selected axis of rotation. The toolplane is used to calculate

     

    # the position of the rotary axis. This is the default setting.

     

    #

     

    #3 Axis Rotary (Polar)

     

    # Polar positioning is offered in Mastercam 3 axis toolpaths through the

     

    # rotary axis options dialog. The selected toolpath is converted to angle

     

    # and radius position. The axis of rotation is forced to zero.

     

    #

     

    #Axis substitution:

     

    # Use the Rotary axis substitution by drawing the geometry flattened

     

    # from the cylinder. The rotary axis button must be active for axis

     

    # substitution information to be output to the NCI file. The radius of

     

    # the rotary diameter is added to all the Z positions at output.

     

    #

     

    #Simultaneous 4 Axis (11 gcode):

     

    # Full 4 axis toolpaths can be generated from various toolpaths under the

     

    # 'multi-axis' selection (i.e. Rotary 4 axis). All 5 axis paths are

     

    # converted to 4 axis paths where only the angle about the rotation axis

     

    # is resolved.

     

    #

     

    #Drill:

     

    # All drill methods are supported in the post. See Simultaneous 4 Axis.

     

    #

     

    # --------------------------------------------------------------------------

     

    #Additional Notes:

     

    # 1) G54 calls are generated where the work offset entry of 0 = G54,

     

    # 1 = G55, etc.

     

    # 2) Metric is applied from the NCI met_tool variable.

     

    # 3) Incremental mode calculates motion from home position at toolchanges.

     

    # The home position is used to define the last position of the tool

     

    # for all toolchanges.

     

    # 4) The variable 'absinc' is now pre-defined, set mi2 (Misc. Integer) for

     

    # the 'top level' absolute/incremental program output. Subprograms are

     

    # updated through the Mastercam dialog settings for sub-programs.

     

    # 5) Always avoid machining to the center of rotation with rotary axis!

     

    # 6) Transform subprograms are intended for use with G54.. workshifts.

     

    #

     

    # END_HEADER$

     

    #

     

    # --------------------------------------------------------------------------

     

    # Debugging and Factory Set Program Switches

     

    # --------------------------------------------------------------------------

     

    #Define Constants

     

    m_one := -1

     

    zero := 0

     

    one := 1

     

    two := 2

     

    three := 3

     

    four := 4

     

    five := 5

     

    c9k := 9999

     

     

     

    bug4$ : 1 #Debug output with the tilde '~'.

     

    #A value greater the zero applies the variable formatting with

     

    #debug output (default is typically FS 1 but not a guarantee).

     

    #A value of zero gets the value directly with NO formatting.

     

     

     

    linktolvar$ : 0 #Associate X tolerance variables to V9- variable?

     

    linkplnvar$ : 0 #Associate X plane specific variables to V9- variable?

     

     

     

    skp_lead_flgs$ : 0 #Do NOT use v9 style contour flags

     

    get_1004$ : 1 #Find gcode 1004 with getnextop?

     

    rpd_typ_v7$ : 0 #Use Version 7 style contour flags/processing?

     

    strtool_v7$ : 2 #Use Version 7+ toolname?

     

    tlchng_aft$ : 2 #Delay call to toolchange until move line

     

    cant_tlchng$ : 1 #Ignore cantext entry on move with tlchng_aft

     

    newglobal$ : 1 #Error checking for global variables

     

    getnextop$ : 1 #Build the next variable table

     

    tooltable$ : 3 #Pre-read, call the pwrtt postblock

     

     

     

    # --------------------------------------------------------------------------

     

    # General Output Settings

     

    # --------------------------------------------------------------------------

     

    maxfeedpm : 500 #SET_BY_MD Limit for feed in inch/min

     

    ltol_m : 0.05 #Length tolerance for arccheck, metric

     

    vtol_m : 0.0025#System tolerance, metric

     

    maxfeedpm_m : 10000 #SET_BY_MD Limit for feed in mm/min

     

    force_wcs : yes$ #Force WCS output at every toolchange?

     

    stagetool : 0 #SET_BY_CD 0 = Do not pre-stage tools, 1 = Stage tools

     

    stagetltype : 1 #0 = Do not stage 1st tool

     

    #1 = Stage 1st tool at last tool change

     

    #2 = Stage 1st tool at end of file (peof)

     

    use_gear : 0 #Output gear selection code, 0=no, 1=yes

     

    min_speed : 50 #SET_BY_MD Minimum spindle speed

     

    progname$ : 1 #Use uppercase for program name (sprogname)

     

    prog_stop : 1 #Program stop at toolchange: 0=None, 1=M01, 2 = M00

     

    tool_info : 2 #Output tooltable information?

     

    #0 = Off - Do not output any tool comments or tooltable

     

    #1 = Tool comments only

     

    #2 = Tooltable in header - no tool comments at T/C

     

    #3 = Tooltable in header - with tool comments at T/C

     

    tlchg_home : no$ #Zero return X and Y axis prior to tool change?

     

     

     

    # The following three initializations are used for full arc and helix arc output when the CD

     

    # is set to output R or signed R for arcs

     

    arctype$ : 2 #Arc center type XY plane 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.

     

    arctypexz$ : 2 #Arc center type XZ plane 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.

     

    arctypeyz$ : 2 #Arc center type YZ plane 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.

     

     

     

    # --------------------------------------------------------------------------

     

    # Rotary Axis Settings

     

    # --------------------------------------------------------------------------

     

    read_md : no$ #Set rotary axis switches by reading Machine Definition?

     

    vmc : 1 #SET_BY_MD 0 = Horizontal Machine, 1 = Vertical Mill

     

    rot_on_x : 1 #SET_BY_MD Default Rotary Axis Orientation

     

    #0 = Off, 1 = About X, 2 = About Y, 3 = About Z

     

    rot_ccw_pos : 0 #SET_BY_MD Axis signed dir, 0 = CW positive, 1 = CCW positive

     

    index : 0 #SET_BY_MD Use index positioning, 0 = Full Rotary, 1 = Index only

     

    ctable : 5 #SET_BY_MD Degrees for each index step with indexing spindle

     

    use_frinv : no$ #SET_BY_CD Use Inverse Time Feedrates in 4 Axis, (0 = no, 1 = yes)

     

    maxfrdeg : 2000 #SET_BY_MD Limit for feed in deg/min

     

    maxfrinv : 999.99#SET_BY_MD Limit for feed inverse time

     

    maxfrinv_m : 99.99 #SET_BY_MD Maximum feedrate - inverse time

     

    frc_cinit : yes$ #Force C axis reset at toolchange

     

    ctol : 225 #Tolerance in deg. before rev flag changes

     

    ixtol : 0.01 #Tolerance in deg. for index error

     

    frdegstp : 10 #Step limit for rotary feed in deg/min

     

    rot_type : 1 #SET_BY_MD Rotary type - 0=signed continuous, 1=signed absolute, 2=shortest direction

     

    force_index : no$ #Force rotary output to index mode when tool plane positioning with a full rotary

     

    use_rotmcode : 0 #Output M-Code for Axis direction (sindx_mc)

     

    #0 = Signed direction (only valid when rot_type = 1)

     

    #1 = M-Code for direction

     

    toolismetric : 0 #flag that tool is metric

     

    tap_feedtype : 1 #0 = Units Per Minute (G94)

     

    #1 = Units Per Revolution (G95)

     

     

     

    #Rotary Axis Label options

     

    use_md_rot_label : no$ #Use rotary axis label from machine def? - Leave set to 'no' until available

     

    srot_x : "A" #Label applied to rotary axis movement - rotating about X axis - used when use_md_rot_label = no

     

    srot_y : "B" #Label applied to rotary axis movement - rotating about Y axis - used when use_md_rot_label = no

     

    srot_z : "C" #Label applied to rotary axis movement - rotating about Z axis - used when use_md_rot_label = no

     

    sminus : "-" #Address for the rotary axis (signed motion)

     

     

     

    #Axis locking

     

    rot_lock : 0 #Use rotary axis lock/unlock codes (0 = no, 1 = yes)

     

    slock : "M10" #Axis lock

     

    sunlock : "M11" #Axis unlock

     

     

     

    # --------------------------------------------------------------------------

     

    # Common User-defined Variable Initializations (not switches!)

     

    # --------------------------------------------------------------------------

     

    xia : 0 #Formatted absolute value for X incremental calculations

     

    yia : 0 #Formatted absolute value for Y incremental calculations

     

    zia : 0 #Formatted absolute value for Z incremental calculations

     

    cia : 0 #Formatted absolute value for C incremental calculations

     

     

     

    cuttype : 0 #Cut type flag

     

    #0 = Tool Plane, 1 = Axis Subs, 2 = Polar, 3 = 4/5 axis

     

    bld : 0 #Block delete active

     

    result : 0 #Return value for functions

     

    sav_spc : 0 #Save spaces

     

    sav_gcode : 0 #Gcode saved

     

    sav_absinc : 0 #Absolute/Incremental Saved Value

     

    sav_coolant : 0 #Coolant saved

     

    sav_frc_wcs : 0 #Force work offset flag saved

     

    toolchng : 1 #On a toolchange flag

     

    toolchng0 : 0 #On a null toolchange flag

     

    spdir2 : 1 #Copy for safe spindle direction calculation

     

     

     

    #Drill variables

     

    drlgsel : -1 #Drill Select Initialize

     

    drillref : 0 #Select drill reference

     

    drlgcode : 0 #Save Gcode in drill

     

    sav_dgcode : 0 #Drill gcode saved

     

     

     

    #Subprogram variables

     

    mr_rt_actv : 0 #Flag to indicate if G51/G68 is active

     

    #0=Off, 1=Rotate initial, 2=G68 Subprogram call/start, 3=Mirror, Neg. enable restore

     

    mr_rt_rst : 0 #Flag to restore abs/inc when G51/G68 is active

     

    rt_csav : 0 #C saved value

     

    end_sub_mny : 0 #Many tool setting captured at transform sub end

     

     

     

    #Rotary/Index variables

     

    csav : 0 #C saved value

     

    prvcabs : 0 #Saved cabs from pe_inc_calc,

     

    #Used for rotary feed and direction calculations

     

    cdelta : 0 #Calculation for angle change

     

    cdelta_calc : 0 #Rotation calculation

     

    rev : 0 #Calculation for deg/min

     

    sav_rev : 0 #Saved revolution counter

     

    indx_out : c9k #Rotation direction calculation

     

    fmt 16 indx_mc #Rotation direction calculation

     

    rev_brkflag : 0 #Revolution break flag. 0 = No break, 1 = Break every 90 or 360 degrees (see pmotion_su)

     

     

     

    #Vector Constants for Rotatary Calculations

     

    aaxisx : 1 #A axis rotation vector constant

     

    aaxisy : 0 #A axis rotation vector constant

     

    aaxisz : 0 #A axis rotation vector constant

     

    baxisx : 0 #B axis rotation vector constant

     

    baxisy : 1 #B axis rotation vector constant

     

    baxisz : 0 #B axis rotation vector constant

     

    caxisx : 0 #C axis rotation vector constant

     

    caxisy : 0 #C axis rotation vector constant

     

    caxisz : 1 #C axis rotation vector constant

     

     

     

    #Feedrate calculation variables

     

    frdelta : 0 #Calculation for deg/min

     

    frinv : 0 #Feedrate inverse time

     

    frdeg : 0 #Feedrate deg/min actual

     

    prvfrdeg : 0 #Feedrate deg/min actual

     

    ldelta : 0 #Calculation for deg/min, linear

     

    cldelta : 0 #Calculation for deg/min, linear and rotary

     

    circum : 0 #Calculation for deg/min

     

    ipr_type : 0 #Feedrate for Rotary, 0 = UPM, 1 = DPM, 2 = Inverse

     

     

     

    comp_type : 0 #Cutter compensation type - 0=computer, 1=control, 2=wear, 3=reverse wear, 4=off

     

     

     

    #rotary_axis2 values are not consistent with rot_on_x values. Need to add 1 to rotary_axis2 to compare them.

     

    rotary_axis2 : c9k #Rotary axis selected in Multiaxis Drill and Curve 5 Axis, 0=X, 1=Y, 2=Z

     

     

     

    #Coolant variables for X style coolant

     

    cant_pos : 0 #Read from current canned text (cant_pos1 - cant_pos20)

     

    coolant_bin : 0 #Binary value for current coolant command

     

    coolant_on : 0 #Binary value holding the sum of all coolants currently on

     

    coolantx : 0 #Selector variable for coolant string selector

     

    local_int : 0 #Local variable for output of coolant off commands

     

    result2 : 0 #Return value for functions

     

    suppress : 0 #Flag used to suppress redundant coolant on commands

     

    all_cool_off : 0 #First coolant off command shuts off ALL coolant options

     

     

     

    #Variables to capture parameter values - use to set post switches in pset_mach

     

    rotaxerror : 0 #Error flag

     

    rot_axis : 0 #Axis of rotation - 1=X, 2=Y, 3=Z

     

    rot_dir : 0 #Rotary direction - CW is positive, 0 = false, 1 = true

     

    rot_index : 0 #Index or continuous - 0 = continuous, 1 = index

     

    rot_angle : 0 #Degrees for each index step with indexing spindle

     

    rot_zero : 0 #Rotary zero degree position (NOT CURRENTLY IMPLEMENTED)

     

    rot_ax_cnt : 0 #Rotary axis counter

     

    component_type : 0 #Component type: (See documentation for complete list - )

     

    #0 = MACHINE

     

    #1 = STOCK_COMPONENT

     

    #2 = MISC_COMPONENT

     

    #3 = MACHINE_BASE_COMPONENT

     

    #4 = LINEAR_AXIS_COMPONENT

     

    #5 = ROTARY_AXIS_COMPONENT

     

    #6 = RECT_TABLE_COMPONENT

     

    #12 = CHUCK_COMPONENT

     

    #24 = TOOL_SPINDLE_COMPONENT

     

    #23 = ATC_COMPONENT

     

    z_dir : 0 #Z Axis direction flag

     

    axis_label : 0 #Axis label - 1=X,2=Y,3=Z

     

    srot_label : "" #Rotary Axis label (Generally A, B or C)

     

    sav_srot_label : "" #Store original rotary axis label (required for signed rotation output rot_type = 1)

     

    sav_index : 0 #Store original index value

     

     

     

    # --------------------------------------------------------------------------

     

    #String and string selector definitions for NC output

     

    # --------------------------------------------------------------------------

     

    #Address string definitions

     

    strm : "M"

     

    strn : "N"

     

    stro : "O"

     

    strp : "P"

     

    srad : "R"

     

    srminus : "R-"

     

    sblank : ""

     

     

     

    #Cantext string definitions (spaces must be padded here)

     

    sm00 : "M00"

     

    sm01 : "M01"

     

    strtextno : ""

     

    strcantext : ""

     

     

     

    #Transform mirror and rotate codes

     

    strns_mir_on : "G51.1" #Programmable mirror image code

     

    strns_mir_off : "G50.1" #Programmable mirror image cancel code

     

    strns_rot_on : "G68" #Coordinate System Rotation

     

    strns_rot_off : "G69" #Coordinate System Rotation Cancel

     

     

     

    #Misc. string definitions

     

    sopen_prn : "(" #String for open parenthesis "("

     

    sclose_prn : ")" #String for close parenthesis ")"

     

    sdelimiter : "|" #String for delimiter

     

    sg95 : "G95" #Feed per rotation

     

    sm29 : "M29" #Rigid tapping preperation support function

     

    sg80 : "G80" #Cancel canned drilling cycle

     

    sg43 : "G43" #Tool length compensation

     

    sg49 : "G49" #Tool length compensation cancel

     

    sg92 : "G92" #Set work piece coordinate system

     

    sm06 : "M6" #Toolchange

     

     

     

    # --------------------------------------------------------------------------

     

    # Error messages

     

    # --------------------------------------------------------------------------

     

    saxiserror : "WARNING - DEFINED AXIS OF ROTATION DOES NOT MATCH OPERATION'S AXIS OF ROTATION - OUTPUT MAY BE INVALID"

     

    sindxerror : "WARNING - INDEX ANGLE DOES NOT MATCH POST SETTING ('ctable')"

     

    stlorgerr : "ERROR - TOOL ORIGIN DOES NOT MATCH CENTER OF ROTATION IN POLAR MILLING"

     

    shomeserror : "ERROR - WORK OFFSET USAGE DOES NOT SUPPORT TRANSFORM SUBPROGRAM"

     

    sprgnerror : "ERROR - SUBPROGRAM NUMBER MATCHES THE MAIN PROGRAM NUMBER"

     

    srotaxerror : "ERROR - MORE THAN 1 ROTARY AXIS DETECTED IN SELECTED AXIS COMBINATION - OUTPUT MAY BE INVALID"

     

     

     

    # --------------------------------------------------------------------------

     

    # General G and M Code String select tables

     

    # --------------------------------------------------------------------------

     

    # Motion G code selection

     

    sg00 : "G0" #Rapid

     

    sg01 : "G1" #Linear feed

     

    sg02 : "G2" #Circular interpolation CW

     

    sg03 : "G3" #Circular interpolation CCW

     

    sg04 : "G4" #Dwell

     

    sgcode : "" #Target string

     

     

     

    fstrsel sg00 gcode$ sgcode 5 -1

     

    # --------------------------------------------------------------------------

     

    # Select work plane G code

     

    sg17 : "G17" #XY plane code

     

    sg19 : "G19" #YZ plane code

     

    sg18 : "G18" #XZ plane code

     

    sgplane : "" #Target string

     

     

     

    fstrsel sg17 plane$ sgplane 3 -1

     

    # --------------------------------------------------------------------------

     

    #Select english/metric code

     

    sg20 : "G20" #Inch code

     

    sg21 : "G21" #Metric code

     

    smetric : "" #Target string

     

     

     

    fstrsel sg20 met_tool$ smetric 2 -1

     

    # --------------------------------------------------------------------------

     

    #Select reference return code

     

    sg28 : "G28" #First reference point return

     

    sg30 : "G30" #Second reference point return

     

    sg28ref : "" #Target string

     

     

     

    fstrsel sg28 mi3$ sg28ref 2 -1

     

    # --------------------------------------------------------------------------

     

    # Cutter compensation G code selection

     

    scc0 : "G40" #Cancel cutter compensation

     

    scc1 : "G41" #Cutter compensation left

     

    scc2 : "G42" #Cutter compensation right

     

    sccomp : "" #Target string

     

     

     

    fstrsel scc0 cc_pos$ sccomp 3 -1

     

    # --------------------------------------------------------------------------

     

    # Canned drill cycle string select

     

    sg81 : "G81" #drill - no dwell

     

    sg81d : "G82" #drill - with dwell

     

    sg83 : "G83" #peck drill - no dwell

     

    sg83d : "G83" #peck drill - with dwell

     

    sg73 : "G73" #chip break - no dwell

     

    sg73d : "G73" #chip break - with dwell

     

    sg84 : "G84" #tap - right hand

     

    sg84d : "G74" #tap - left hand

     

    sg85 : "G85" #bore #1 - no dwell

     

    sg85d : "G89" #bore #1 - with dwell

     

    sg86 : "G86" #bore #2 - no dwell

     

    sg86d : "G86" #bore #2 - with dwell

     

    sgm1 : "G76" #fine bore - no dwell

     

    sgm1d : "G76" #fine bore - with dwell

     

    sgm2 : "G84" #rigid tap - right hand

     

    sgm2d : "G74" #rigid tap - left hand

     

    sgdrill : "" #Target string

     

     

     

    fstrsel sg81 drlgsel sgdrill 16 -1

     

    # --------------------------------------------------------------------------

     

    # Select incremental or absolute G code

     

    sg90 : "G90" #Absolute code

     

    sg91 : "G91" #Incremental code

     

    sgabsinc : "" #Target string

     

     

     

    fstrsel sg90 absinc$ sgabsinc 2 -1

     

    # --------------------------------------------------------------------------

     

    # Feed mode G code selection

     

    sg94 : "G94" #UPM

     

    sg94d : "G94" #DPM, See pfcalc_deg if you use another gcode

     

    sg93 : "G93" #Inverse

     

    sgfeed : "" #Target string

     

     

     

    fstrsel sg94 ipr_type sgfeed 3 -1

     

    # --------------------------------------------------------------------------

     

    #Canned drill cycle reference height

     

    sg98 : "G98" #Reference at initht

     

    sg99 : "G99" #Reference at refht

     

    sgdrlref : "" #Target string

     

     

     

    fstrsel sg98 drillref sgdrlref 2 -1

     

    # --------------------------------------------------------------------------

     

    # Generate string for spindle

     

    sm04 : "M4" #Spindle reverse

     

    sm05 : "M5" #Spindle off

     

    sm03 : "M3" #Spindle forward

     

    spindle : "" #Target string

     

     

     

    fstrsel sm04 spdir2 spindle 3 -1

     

    # --------------------------------------------------------------------------

     

    # Coolant M code selection for V9 style coolant

     

    # Note: To enable V9 style coolant, click on the General Machine Parameters icon

     

    # in the Machine Definition Manager, Coolant tab, enable first check box

     

    # Output of V9 style coolant commands in this post is controlled by scoolant

     

    sm09 : "M9" #Coolant Off

     

    sm08 : "M8" #Coolant Flood

     

    sm08_1 : "M8" #Coolant Mist

     

    sm08_2 : "M8" #Coolant Tool

     

    scoolant : "" #Target string

     

     

     

    fstrsel sm09 coolant$ scoolant 4 -1

     

    # --------------------------------------------------------------------------

     

    # Coolant output code selection for X style coolant

     

    # Note: To enable X style coolant, click on the General Machine Parameters icon

     

    # in the Machine Definition Manager, Coolant tab, disable first check box

     

    # Output of X style coolant commands in this post is controlled by pcan, pcan1, & pcan2

     

    scool50 : "M8" #Coolant 1 on value

     

    scool51 : "M9" #Coolant 1 off value

     

    scool52 : "M7" #Coolant 2 on value

     

    scool53 : "M9" #Coolant 2 off value

     

    scool54 : "M88" #Coolant 3 on value

     

    scool55 : "M89" #Coolant 3 off value

     

    scool56 : "M8(Coolant4=ON)" #Coolant 4 on value

     

    scool57 : "M9(Coolant4=OFF)" #Coolant 4 off value

     

    scool58 : "M8(Coolant5=ON)" #Coolant 5 on value

     

    scool59 : "M9(Coolant5=OFF)" #Coolant 5 off value

     

    scool60 : "M8(Coolant6=ON)" #Coolant 6 on value

     

    scool61 : "M9(Coolant6=OFF)" #Coolant 6 off value

     

    scool62 : "M8(Coolant7=ON)" #Coolant 7 on value

     

    scool63 : "M9(Coolant7=OFF)" #Coolant 7 off value

     

    scool64 : "M8(Coolant8=ON)" #Coolant 8 on value

     

    scool65 : "M9(Coolant8=OFF)" #Coolant 8 off value

     

    scool66 : "M8(Coolant9=ON)" #Coolant 9 on value

     

    scool67 : "M9(Coolant9=OFF)" #Coolant 9 off value

     

    scool68 : "M8(Coolant10=ON)" #Coolant 10 on value

     

    scool69 : "M9(Coolant10=OFF)" #Coolant 10 off value

     

    scoolantx : "" #Target string

     

     

     

    fstrsel scool50 coolantx scoolantx 20 -1

     

    # --------------------------------------------------------------------------

     

    #X coolant has the option - First coolant off command shuts off ALL coolant options

     

    sall_cool_off : "M09" #Coolant off command output with all_cool_off

     

     

     

    # --------------------------------------------------------------------------

     

    # Table rotation direction, index

     

    sindx_cw : "M22" #Rotate CW code

     

    sindx_ccw : "M21" #Rotate CCW code

     

    sindx_mc : "" #Target string

     

     

     

    fstrsel sindx_cw indx_mc sindx_mc 2 -1

     

    # --------------------------------------------------------------------------

     

    # Define the gear selection code

     

    flktbl 1 3 #Lookup table definition - table no. - no. entries

     

    40 0 #Low gear range

     

    41 400 #Med gear range

     

    42 2250 #Hi gear range

     

     

     

    # --------------------------------------------------------------------------

     

    # Define coolant binary value for X style coolant

     

    flktbl 2 20 #Lookup table definition - table no. - no. entries

     

    1 50 #Coolant 1 on value

     

    2 51 #Coolant 1 off value

     

    4 52 #Coolant 2 on value

     

    8 53 #Coolant 2 off value

     

    16 54 #Coolant 3 on value

     

    32 55 #Coolant 3 off value

     

    64 56 #Coolant 4 on value

     

    128 57 #Coolant 4 off value

     

    256 58 #Coolant 5 on value

     

    512 59 #Coolant 5 off value

     

    1024 60 #Coolant 6 on value

     

    2048 61 #Coolant 6 off value

     

    4096 62 #Coolant 7 on value

     

    8192 63 #Coolant 7 off value

     

    16384 64 #Coolant 8 on value

     

    32768 65 #Coolant 8 off value

     

    65536 66 #Coolant 9 on value

     

    131072 67 #Coolant 9 off value

     

    262144 68 #Coolant 10 on value

     

    524288 69 #Coolant 10 off value

     

     

     

    # --------------------------------------------------------------------------

     

    # Month selector

     

    smon0 : ""

     

    smon1 : "JAN."

     

    smon2 : "FEB."

     

    smon3 : "MAR."

     

    smon4 : "APR."

     

    smon5 : "MAY."

     

    smon6 : "JUN."

     

    smon7 : "JUL."

     

    smon8 : "AUG."

     

    smon9 : "SEP."

     

    smon10 : "OCT."

     

    smon11 : "NOV."

     

    smon12 : "DEC."

     

    smonth : "" #Target string

     

     

     

    fstrsel smon0 month$ smonth 13 -1

     

    # --------------------------------------------------------------------------

     

    # Cutter Compensation Type

     

    scomp : "COMPUTER"

     

    scomp1 : "CONTROL COMP"

     

    scomp2 : "WEAR COMP"

     

    scomp3 : "REVERSE WEAR COMP"

     

    scomp4 : "OFF"

     

    scomp_type : "" #Target string

     

     

     

    fstrsel scomp comp_type scomp_type 5 -1

     

    # --------------------------------------------------------------------------

     

    # Format statements - n=nonmodal, l=leading, t=trailing, i=inc, d=delta

     

    # --------------------------------------------------------------------------

     

    #Default english/metric position format statements

     

    fs2 1 0.7 0.6 #Decimal, absolute, 7 place, default for initialize (:)

     

    fs2 2 0.4 0.3 #Decimal, absolute, 4/3 place

     

    fs2 3 0.4 0.3d #Decimal, delta, 4/3 place

     

    #Common format statements

     

    fs2 4 1 0 1 0 #Integer, not leading

     

    fs2 5 2 0 2 0l #Integer, force two leading

     

    fs2 6 3 0 3 0l #Integer, force three leading

     

    fs2 7 4 0 4 0l #Integer, force four leading

     

    fs2 9 0.1 0.1 #Decimal, absolute, 1 place

     

    fs2 10 0.2 0.2 #Decimal, absolute, 2 place

     

    fs2 11 0.3 0.3 #Decimal, absolute, 3 place

     

    fs2 12 0.4 0.4 #Decimal, absolute, 4 place

     

    fs2 13 0.5 0.5 #Decimal, absolute, 5 place

     

    fs2 14 0.3 0.3d #Decimal, delta, 3 place

     

    fs2 15 0.2 0.1 #Decimal, absolute, 2/1 place (feedrate)

     

    fs2 16 1 0 1 0n #Integer, forced output

     

    fs2 17 0.2 0.3 #Decimal, absolute, 2/3 place (tapping feedrate)

     

     

     

    # These formats used for 'Date' & 'Time'

     

    fs2 18 2.2 2.2lt #Decimal, force two leading & two trailing (time2)

     

    fs2 19 2 0 2 0t #Integer, force trailing (hour)

     

    fs2 20 0 2 0 2lt #Integer, force leading & trailing (min)

     

     

     

    # This format statement is used for sequence number output

     

    # Number of places output is determined by value for "Increment Sequence Number" in CD

     

    # Max depth to the right of the decimal point is set in the fs statement below

     

    fs2 21 0^7 0^7 #Decimal, 7 place, omit decimal if integer value

     

    fs2 22 0^3 0^3 #Decimal, 3 place, omit decimal if integer value

     

     

     

    # --------------------------------------------------------------------------

     

    # Toolchange / NC output Variable Formats

     

    # --------------------------------------------------------------------------

     

    fmt "T" 4 t$ #Tool number

     

    fmt "T" 4 first_tool$ #First tool used

     

    fmt "T" 4 next_tool$ #Next tool used

     

    fmt "D" 4 tloffno$ #Diameter offset number

     

    fmt "H" 4 tlngno$ #Length offset number

     

    fmt "G" 4 g_wcs #WCS G address

     

    fmt "P" 4 p_wcs #WCS P address

     

    fmt "S" 4 speed #Spindle Speed

     

    fmt "M" 4 gear #Gear range

     

    # --------------------------------------------------------------------------

     

    fmt "N" 21 n$ #Sequence number

     

    fmt "X" 2 xabs #X position output

     

    fmt "Y" 2 yabs #Y position output

     

    fmt "Z" 2 zabs #Z position output

     

    fmt "X" 3 xinc #X position output

     

    fmt "Y" 3 yinc #Y position output

     

    fmt "Z" 3 zinc #Z position output

     

    fmt "A" 11 cabs #C axis position

     

    fmt "A" 14 cinc #C axis position

     

    fmt "A" 22 indx_out #Index position

     

    fmt "R" 14 rt_cinc #C axis position, G68

     

    fmt "I" 3 iout #Arc center description in X

     

    fmt "J" 3 jout #Arc center description in Y

     

    fmt "K" 3 kout #Arc center description in Z

     

    fmt "R" 2 arcrad$ #Arc Radius

     

    fmt "F" 15 feed #Feedrate

     

    fmt "P" 11 dwell$ #Dwell

     

    fmt "M" 5 cantext$ #Canned text

     

    fmt "F" 2 pitch #Tap pitch (units per thread)

     

    # --------------------------------------------------------------------------

     

    #Move comment (pound) to output colon with program numbers

     

    fmt "O" 7 progno$ #Program number

     

    #fmt ":" 7 progno$ #Program number

     

    fmt "O" 7 main_prg_no$ #Program number

     

    #fmt ":" 7 main_prg_no$ #Program number

     

    fmt "O" 7 sub_prg_no$ #Program number

     

    #fmt ":" 7 sub_prg_no$ #Program number

     

    fmt "X" 2 sub_trnsx$ #Rotation point

     

    fmt "Y" 2 sub_trnsy$ #Rotation point

     

    fmt "Z" 2 sub_trnsz$ #Rotation point

     

    # --------------------------------------------------------------------------

     

    fmt "Q" 2 peck1$ #First peck increment (positive)

     

    fmt "Q" 2 shftdrl$ #Fine bore tool shift

     

    fmt "R" 2 refht_a #Reference height

     

    fmt "R" 2 refht_i #Reference height

     

    # --------------------------------------------------------------------------

     

    fmt "TOOL - " 4 tnote #Note format

     

    fmt "DIA. OFF. - " 4 toffnote #Note format

     

    fmt "LEN. - " 4 tlngnote #Note format

     

    fmt "TOOL DIA. - " 1 tldia$ #Note format

     

    fmt "XY STOCK TO LEAVE - " 2 xy_stock #Note format

     

    fmt "Z STOCK TO LEAVE - " 2 z_stock #Note format

     

    # --------------------------------------------------------------------------

     

    fmt 4 year2 #Calculated year value

     

    fmt 18 time2 #Capture 24-hour time value into 'time2' variable

     

    fmt 19 hour #Hour

     

    fmt 20 min #Minutes

     

    year2 = year$ + 2000

     

     

     

    # --------------------------------------------------------------------------

     

    # Tool Comment / Manual Entry Section

     

    # --------------------------------------------------------------------------

     

    ptoolcomment #Comment for tool

     

    tnote = t$, toffnote = tloffno$, tlngnote = tlngno$

     

    if tool_info = 1 | tool_info = 3,

     

    sopen_prn, pstrtool, sdelimiter, *tnote, sdelimiter, *toffnote, sdelimiter, *tlngnote, sdelimiter, *tldia$, sclose_prn, e$

     

     

     

    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

     

     

     

    pstrtool #Comment for tool

     

    if strtool$ <> sblank,

     

    [

     

    strtool$ = ucase(strtool$)

     

    *strtool$

     

    ]

     

     

     

    pcomment$ #Comment from manual entry (must call pcomment2)

     

    pcomment2 #Required if doing boolean 'if' logic testing!

     

     

     

    pcomment2 #Output Comment from manual entry

     

    scomm$ = ucase (scomm$)

     

    if gcode$ = 1005, sopen_prn, scomm$, sclose_prn, e$ #Manual entry - as comment

     

    if gcode$ = 1006, scomm$, e$ #Manual entry - as code

     

    if gcode$ = 1007, sopen_prn, scomm$, sclose_prn #Manual entry - as comment with move NO e$

     

    if gcode$ = 1026, scomm$ #Manual entry - as code with move NO e$

     

    if gcode$ = 1008, sopen_prn, scomm$, sclose_prn, e$ #Operation comment

     

    if gcode$ = 1051, sopen_prn, scomm$, sclose_prn, e$ #Machine name

     

    if gcode$ = 1052, sopen_prn, scomm$, sclose_prn, e$ #Group comment

     

    if gcode$ = 1053, sopen_prn, scomm$, sclose_prn, e$ #Group name

     

    if gcode$ = 1054, sopen_prn, scomm$, sclose_prn, e$ #File Descriptor

     

     

     

    # --------------------------------------------------------------------------

     

    # Start of File and Toolchange Setup

     

    # --------------------------------------------------------------------------

     

    ptime #Convert 24-hour time format into 12-hour AM/PM format

     

    if time$ >= 13, time2 = (time$ - 12)

     

    else, time2 = time$

     

    hour = int(time2), min = frac(time2)

     

    *hour, ":", *min,

     

    if time$ > 12, " PM"

     

    else, " AM"

     

     

     

     

     

    pheader$ #Call before start of file

     

    result = runvbs(strVBS)

     

    pheader_custer

     

     

     

     

     

    strVBS : ""

     

    # --------------------------------------------------------------------------

     

    # Buffer 2

     

    # --------------------------------------------------------------------------

     

    sbufname2$ : "username.vbs" # "Point" to the external text file

     

    rc2 : 0 # This variable will be the 'record read pointer' for buffer 3

     

    wc2 : 0 # This variable will be the 'record read pointer' for buffer 3

     

    b2_size : 0 # Define a variable to hold the 'size' of the buffer

     

    svbsfile : ""

     

     

     

    fbuf 2 1 80 1 1# Define a string buffer (3rd parameter is '80')

     

     

     

    # --------------------------------------------------------------------------

     

    # Buffer 4 - Holds the variable 't' for each toolpath segment

     

    # --------------------------------------------------------------------------

     

    sbufname3$ : "username.txt"

     

    stext : ""

     

    rc3 : 0

     

    b3_size : 0

     

    fbuf 3 0 80 1 1# Buffer 4

     

     

     

    pwritebuf2 # User defined postblock to write to a buffer

     

    if fexist(sbufname2$),

     

    else,

     

    [

     

    sbufname2$ = spathpst$ + sbufname2$

     

    strVBS = sbufname2$

     

    svbsfile = "Call Main()"

     

    svbsfile = wbuf (2,1)

     

    svbsfile = "Sub Main()"

     

    svbsfile = wbuf (2,2)

     

    svbsfile = " Dim objFSO, strParamsFile"

     

    svbsfile = wbuf (2,3)

     

    svbsfile = " Dim objTS, objNetwork, strUserName "

     

    svbsfile = wbuf (2,4)

     

    svbsfile = ' Set objNetwork = CreateObject("WScript.Network")'

     

    svbsfile = wbuf (2,5)

     

    svbsfile = " strUserName = objNetwork.UserName"

     

    svbsfile = wbuf (2,6)

     

    svbsfile = ' strParamsFile = GetPathFromExtension("NC")'

     

    svbsfile = wbuf (2,7)

     

    svbsfile = ' strParamsFile = strParamsFile & "username.txt"'

     

    svbsfile = wbuf (2,8)

     

    svbsfile = ' Set objFSO = CreateObject("Scripting.FileSystemObject")'

     

    svbsfile = wbuf (2,9)

     

    svbsfile = " Set objTS = objFSO.CreateTextFile(strParamsFile, True)"

     

    svbsfile = wbuf (2,10)

     

    svbsfile = " objTS.WriteLine(strUserName)"

     

    svbsfile = wbuf (2,11)

     

    svbsfile = " objTS.Close"

     

    svbsfile = wbuf (2,12)

     

    svbsfile = " Set objFSO = Nothing"

     

    svbsfile = wbuf (2,13)

     

    svbsfile = " Set objNetwork = Nothing"

     

    svbsfile = wbuf (2,14)

     

    svbsfile = "End Sub"

     

    svbsfile = wbuf (2,15)

     

    result = fclose(2)

     

    ]

     

     

     

     

     

     

     

    #-----------------------------------------------------------------------------

     

    # Read

    #-----------------------------------------------------------------------------

     

    preadbuf3

    sbufname3$ = spathnc$ + sbufname3$

     

    b3_size = rbuf(3, 0)

    rc3 = 1

    while rc3 <= b3_size,

     

    [

     

    stext = rbuf (3, rc3)

     

    stext = ucase (stext)

     

    "(POST BY - ", stext,")",e$

     

    ]

     

    if fexist(sbufname3$), result = remove(sbufname3$)

     

     

     

    pprep$

     

    pwritebuf2

     

     

     

     

     

     

     

     

     

     

     

    pheader_custer #Call before start of file

     

    if met_tool$ = one, #Metric constants and variable adjustments

     

    [

     

    ltol$ = ltol_m

     

    vtol$ = vtol_m

     

    maxfeedpm = maxfeedpm_m

     

    ]

     

    "%",e$

     

    *progno$, e$

     

    "(PROGRAM NAME - ", sprogname$, ")", e$

     

    "(DATE, Day-Month-Year - ", date$, " TIME, Hr:Min - ", time$, ")",e$

     

    preadbuf3

     

     

     

     

     

     

     

     

     

    psof0$ #Start of file for tool zero

     

    psof$

     

     

     

    psof$ #Start of file for non-zero tool number

     

    pcuttype

     

    toolchng = one

     

    if ntools$ = one,

     

    [

     

    #skip single tool outputs, stagetool must be on

     

    stagetool = m_one

     

    !next_tool$

     

    ]

     

    pbld, n$, *smetric, e$

     

    pbld, n$, *sgcode, *sgplane, scc0, sg49, sg80, *sgabsinc, e$

     

    sav_absinc = absinc$

     

    if mi1$ <= one, #Work coordinate system

     

    [

     

    absinc$ = one

     

    pfbld, n$, sgabsinc, *sg28ref, "Z0.", e$

     

    pfbld, n$, *sg28ref, "X0.", "Y0.", e$

     

    pfbld, n$, sg92, *xh$, *yh$, *zh$, e$

     

    absinc$ = sav_absinc

     

    ]

     

    pcom_moveb

     

    pcheckaxis

     

    c_mmlt$ #Multiple tool subprogram call

     

    ptoolcomment

     

    comment$

     

    pcan

     

    pbld, n$, *t$, sm06, e$

     

    pindex

     

    if mi1$ > one, absinc$ = zero

     

    pcan1, pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout,

     

    [if nextdc$ <> 7, *speed, *spindle], pgear, strcantext, e$

     

    pbld, n$, sg43, *tlngno$, pfzout, scoolant, pstagetool, e$

     

    absinc$ = sav_absinc

     

    pbld, n$, sgabsinc, e$

     

    pcom_movea

     

    toolchng = zero

     

    c_msng$ #Single tool subprogram call

     

     

     

    ptlchg0$ #Call from NCI null tool change (tool number repeats)

     

    pcuttype

     

    toolchng0 = one

     

    pcom_moveb

     

    pcheckaxis

     

    c_mmlt$ #Multiple tool subprogram call

     

    comment$

     

    pcan

     

    result = newfs(15, feed) #Reset the output format for 'feed'

     

    pbld, n$, sgplane, e$

     

    pspindchng

     

    pbld, n$, scoolant, e$

     

    if mi1$ > one & workofs$ <> prv_workofs$,

     

    [

     

    sav_absinc = absinc$

     

    absinc$ = zero

     

    pbld, n$, sgabsinc, pwcs, pfxout, pfyout, pfzout, pfcout, e$

     

    pe_inc_calc

     

    ps_inc_calc

     

    absinc$ = sav_absinc

     

    ]

     

    if cuttype = zero, ppos_cax_lin

     

    if gcode$ = one, plinout

     

    else, prapidout

     

    pcom_movea

     

    toolchng0 = zero

     

    c_msng$ #Single tool subprogram call

     

    !xnci$, !ynci$, !znci$

     

     

     

    ptlchg$ #Tool change

     

    pcuttype

     

    toolchng = one

     

    if mi1$ = one, #Work coordinate system

     

    [

     

    pfbld, n$, *sg28ref, "X0.", "Y0.", e$

     

    pfbld, n$, sg92, *xh$, *yh$, *zh$, e$

     

    ]

     

    if prog_stop = 1, pbld, n$, *sm01, e$

     

    if prog_stop = 2, pbld, n$, *sm00, e$

     

    pcom_moveb

     

    pcheckaxis

     

    c_mmlt$ #Multiple tool subprogram call

     

    ptoolcomment

     

    comment$

     

    pcan

     

    result = newfs(15, feed) #Reset the output format for 'feed'

     

    pbld, n$, *t$, sm06, e$

     

    pindex

     

    sav_absinc = absinc$

     

    if mi1$ > one, absinc$ = zero

     

    pcan1, pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout,

     

    [if nextdc$ <> 7, *speed, *spindle], pgear, strcantext, e$

     

    pbld, n$, sg43, *tlngno$, pfzout, scoolant, pstagetool, e$

     

    absinc$ = sav_absinc

     

    pbld, n$, sgabsinc, e$

     

    pcom_movea

     

    toolchng = zero

     

    c_msng$ #Single tool subprogram call

     

    !xnci$, !ynci$, !znci$

     

     

     

    pstagetool #Pre-stage tools

     

    if stagetool = 1,

     

    [

     

    if ttblend$, #Check for last toolchange

     

    [

     

    if stagetltype = 1, *next_tool$ #stage first tool at last toolchange

     

    ]

     

    else, *next_tool$ #stage tool at every toolchange

     

    ]

     

     

     

    pretract #End of tool path, toolchange

     

    sav_absinc = absinc$

     

    absinc$ = one

     

    sav_coolant = coolant$

     

    coolant$ = zero

     

     

     

    # if nextop$ = 1003, #Uncomment this line to leave coolant on until eof unless

     

    [ # explicitely turned off through a canned text edit

     

    if all_cool_off,

     

    [

     

    #all coolant off with a single off code here

     

    if coolant_on, pbld, n$, sall_cool_off, e$

     

    coolant_on = zero

     

    ]

     

    else,

     

    [

     

    local_int = zero

     

    coolantx = zero

     

    while local_int < 20 & coolant_on > 0,

     

    [

     

    coolantx = and(2^local_int, coolant_on)

     

    local_int = local_int + one

     

    if coolantx > zero,

     

    [

     

    coolantx = local_int

     

    pbld, n$, scoolantx, e$

     

    ]

     

    coolantx = zero

     

    ]

     

    coolant_on = zero

     

    ]

     

    ]

     

    #cc_pos is reset in the toolchange here

     

    cc_pos$ = zero

     

    gcode$ = zero

     

    pbld, n$, sccomp, *sm05, psub_end_mny, e$

     

    pbld, n$, sgabsinc, sgcode, *sg28ref, "Z0.", scoolant, e$

     

    if nextop$ = 1003 | tlchg_home, pbld, n$, *sg28ref, "X0.", "Y0.", protretinc, e$

     

    else, pbld, n$, protretinc, e$

     

    absinc$ = sav_absinc

     

    coolant$ = sav_coolant

     

     

     

    protretinc #Reset the C axis revolution counter

     

    if frc_cinit & rot_on_x,

     

    [

     

    rev = zero

     

    sav_rev = zero

     

    cabs = zero

     

    csav = zero

     

    indx_out = zero

     

    if index, e$, pindxcalc, pindex

     

    else, *cabs

     

    prvcabs = zero

     

    !csav, !cabs

     

    ]

     

     

     

    peof0$ #End of file for tool zero

     

    peof$

     

     

     

    peof$ #End of file for non-zero tool

     

    pretract

     

    comment$

     

    if stagetool = 1 & stagetltype = 2, pbld, n$, *first_tool$, e$

     

    n$, "M30", e$

     

    mergesub$

     

    clearsub$

     

    mergeaux$

     

    clearaux$

     

    "%", e$

  8. 1.post create vbscript .

    2.post run this vbscript,this vbscript create "username.txt" file.

    3.post import "username.txt" The contents of the file to nc program

     

    1 is OK,but 2 & 3 error

    14 Aug 2012 06:07:53 PM - <2> - RUN TIME - C:\Documents and Settings\All Users\Documents\shared mcamx5\MILL\POSTS\username.vbs Error opening

    14 Aug 2012 06:07:53 PM - <2> - RUN TIME - D:\NC\username.txt Error opening

  9. everybody have any good idea?

     

    Below is error msg,

     

    14 Aug 2012 06:07:53 PM - <2> - RUN TIME - C:\Documents and Settings\All Users\Documents\shared mcamx5\MILL\POSTS\username.vbs Error opening

    14 Aug 2012 06:07:53 PM - <2> - RUN TIME - D:\NC\username.txt Error opening

    14 Aug 2012 06:07:53 PM - <2> - RUN TIME - PST(563), NCI(98) - Result type is wrong for formula

     

     

     

    Below my PST Code

     

    strVBS : ""

    # --------------------------------------------------------------------------

    # Buffer 2

    # --------------------------------------------------------------------------

    sbufname2$ : "username.vbs" # "Point" to the external text file

    rc2 : 0 # This variable will be the 'record read pointer' for buffer 3

    wc2 : 0 # This variable will be the 'record read pointer' for buffer 3

    b2_size : 0 # Define a variable to hold the 'size' of the buffer

    svbsfile : ""

     

    fbuf 2 1 80 1 1# Define a string buffer (3rd parameter is '80')

     

    # --------------------------------------------------------------------------

    # Buffer 4 - Holds the variable 't' for each toolpath segment

    # --------------------------------------------------------------------------

    sbufname3$ : "username.txt"

    stext : ""

    rc3 : 0

    b3_size : 0

    fbuf 3 0 80 1 1# Buffer 4

     

    pwritebuf2 # User defined postblock to write to a buffer

    if fexist(sbufname2$),

    else,

    [

    sbufname2$ = spathpst$ + sbufname2$

    strVBS = sbufname2$

    svbsfile = "Call Main()"

    svbsfile = wbuf (2,1)

    svbsfile = "Sub Main()"

    svbsfile = wbuf (2,2)

    svbsfile = " Dim objFSO, strParamsFile"

    svbsfile = wbuf (2,3)

    svbsfile = " Dim objTS, objNetwork, strUserName "

    svbsfile = wbuf (2,4)

    svbsfile = ' Set objNetwork = CreateObject("WScript.Network")'

    svbsfile = wbuf (2,5)

    svbsfile = " strUserName = objNetwork.UserName"

    svbsfile = wbuf (2,6)

    svbsfile = ' strParamsFile = GetPathFromExtension("NC")'

    svbsfile = wbuf (2,7)

    svbsfile = ' strParamsFile = strParamsFile & "username.txt"'

    svbsfile = wbuf (2,8)

    svbsfile = ' Set objFSO = CreateObject("Scripting.FileSystemObject")'

    svbsfile = wbuf (2,9)

    svbsfile = " Set objTS = objFSO.CreateTextFile(strParamsFile, True)"

    svbsfile = wbuf (2,10)

    svbsfile = " objTS.WriteLine(strUserName)"

    svbsfile = wbuf (2,11)

    svbsfile = " objTS.Close"

    svbsfile = wbuf (2,12)

    svbsfile = " Set objFSO = Nothing"

    svbsfile = wbuf (2,13)

    svbsfile = " Set objNetwork = Nothing"

    svbsfile = wbuf (2,14)

    svbsfile = "End Sub"

    svbsfile = wbuf (2,15)

    result = fclose(2)

    ]

     

     

     

    #-----------------------------------------------------------------------------

    # Read License

    #-----------------------------------------------------------------------------

    preadbuf3 # Call to our postlock that reads in from buffer #3 (6/21/2002)

    sbufname3$ = spathnc$ + sbufname3$

    b3_size = rbuf(3, 0) # The '0' record of a buffer ALWAYS contains a

    rc3 = 1 # Our text data start at record #1

    while rc3 <= b3_size,

    [

    stext = rbuf (3, rc3)

    stext = ucase (stext)

    "(POST BY - ", stext,")",e$

    ]

    if fexist(sbufname3$), result = remove(sbufname3$)

     

    pprep$

    pwritebuf2

     

    pheader$ #Call before start of file

     

    result = runvbs(strVBS)

    pheader_custer

     

     

     

    pheader_custer #Call before start of file

    if met_tool$ = one, #Metric constants and variable adjustments

    [

    ltol$ = ltol_m

    vtol$ = vtol_m

    maxfeedpm = maxfeedpm_m

    ]

    "%",e$

    *progno$, e$

    "(PROGRAM NAME - ", sprogname$, ")", e$

    "(DATE, Day-Month-Year - ", date$, " TIME, Hr:Min - ", time$, ")",e$

    preadbuf3

     

  10. I dot know mastercam X6 Renishaw probe variables is...?

     

     

     

    This nci file

     

    1050

    15 46 0 0 0 0 0 0 C:\DOCUMENTS AND SETTINGS\JIM\DESKTOP\1.MCX-6

    1042

     

    999

    152 0 0

    1056

    (PRB_PST PP_START_OF_PROG_HEADER_DATA PRB_PST)

    1056

    (PRB_PST UnitMode=Metric PRB_PST)

    1056

    (PRB_PST 3|14|1 PRB_PST)

    1056

    (PRB_PST TOP|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST FRONT|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST BACK|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST BOTTOM|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST RIGHT SIDE|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST LEFT SIDE|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST ISO|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST top|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST front|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST back|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST bottom|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST right|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST left|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST iso|#1|0|0|0|0|0|0|0|1|0|0|0|0|1| PRB_PST)

    1056

    (PRB_PST PP_END_OF_PROG_HEADER_DATA PRB_PST)

    1056

    (PRB_PST PP_START_OF_PROBE_DB_DATA PRB_PST)

    1056

    (PRB_PST ;Renishaw Productivity+ Probe Database PRB_PST)

    1056

    (PRB_PST ProbeDatabase~Version 1 1 PRB_PST)

    1056

    (PRB_PST ; Please do NOT remove the preceeding 2 lines PRB_PST)

    1056

    (PRB_PST ; Please feel free to add comments here... PRB_PST)

    1056

    (PRB_PST ; etc... PRB_PST)

    1056

    (PRB_PST 2 PRB_PST)

    1056

    (PRB_PST ~2n1|k2~4l1|k4~3l1|5-1~1l1|5SampleProbe~17n1|k2~16n1|217~15n1|27~14n1|24.5~13n1|2100~12n1|26~1dl0|s~19k1|k1~11k1|31~10l1|k2~1al1|31~1bl0|s~22k1|20.425~21l1|20~24k1|k1~23n1|k2 PRB_PST)

    1056

    (PRB_PST 1;3;0;0;0;1;0;0;0;0;0;0;0;0;0.000000;0.000000;0.000000;0.000000;0.000000;;% PRB_PST)

    1056

    (PRB_PST ~2n1|k3~4l1|k3~3l1|5137~1l1|5Probe~17n1|k2~16n1|217~15n1|27~14n1|24.5~13n1|2100~12n1|26~1dl0|s~19k1|k1~11k1|31~10l1|k2~1al1|30~1bl0|s~22k1|20.425~21l1|263.5~24l1|k1~23n1|k2 PRB_PST)

    1056

    (PRB_PST 1;3;0;0;0;1;0;0;0;0;0;0;0;0;0.000000;0.000000;0.000000;0.000000;0.000000; ;% PRB_PST)

    1056

    (PRB_PST PP_END_OF_PROBE_DB_DATA PRB_PST)

    1056

    (PRB_PST PP_PROBING_HEADER_PLACEHOLDER PRB_PST)

    1056

    (PRB_PST PP_START_OF_NC_OP PRB_PST)

    1043

     

    1042

     

    999

    151 0 9

    1056

    (PRB_PST PP_END_OF_NC_OP PRB_PST)

    1056

    (PRB_PST PP_START_OF_PROBING_OPERATION_DATA PRB_PST)

    1056

    (PRB_PST v20 5 0 1 1 PRB_PST)

    1056

    (PRB_PST 0 PRB_PST)

    1056

    (PRB_PST PRB_PST)

    1056

    (PRB_PST 1|2011 3Cycle1| PRB_PST)

    1056

    (PRB_PST ~8l1|250~am1|31~9l2|5SampleProbe~3l1|25~2k1|23~1l1|23~1fk1|74#40701?0.25~1ek1|74#40A01?0.25~1dk1|74#40B01?0.25~1ck1|74#40C01?0.25~1al1|73#1?6?0?0.05?-0.05#1?6?0?0.05?-0.05#1?6?0?0.05?-0.05~1bl1|72#1?6?0?1?-1~19l1|71#1?6?0?0.05?-0.05~14k1|5~13k1|k1~16k1|4100~15k1|4100~2bk1|74#40601?0.25~2ak1|74#40501?0.25~20l1|74#40101?0.25~28m1|5FRONT PRB_PST)

    1056

    (PRB_PST 1|0012 Point1| PRB_PST)

    1056

    (PRB_PST ~4l203|7103#1?7?0.01?0.05?-0.05#1?7?0.01?0.05?-0.05#1?7?0.01?0.05?-0.05~bk1|k1~6l1|20~5l1|k2~2n1|8-41;36;10~8l3|8-41;36;10~1n1|8-41;36;0~7l3|8-41;36;0~85l1|k2~84l1|k2~83k1|k2~82k1|k2 PRB_PST)

    1056

    (PRB_PST 1|0023 Line1| PRB_PST)

    1056

    (PRB_PST ~dk1|k1~4l3|21~3l3|21~8l1|k2~7l1|36~al1|k1~6k1|20~bl1|k1~5k1|21~9k1|1341.222~2m1|850;-17;10~1m1|8-50;17;10~cl1|k1~1dl203|7102#1?6?0?1?-1~1cl203|7102#1?6?0?1?-1~1bl203|7102#1?6?0?1?-1~13k203|7104#40B01?0.1~11l3|2-5~14k1|80;0;10~26l203|7104#40101?0.1~23k1|20~22l1|k1~25l3|850;-17;10~24l3|8-50;17;10~85k1|k2~84l1|k1~83k1|k2~82k1|k2 PRB_PST)

    1056

    (PRB_PST 1|2064 Report1| PRB_PST)

    1056

    (PRB_PST ~ck1|33~ak1|5~bk1|k2~ek1|k0~8k1|5~9k1|k2~dk1|k0~2k1|k2~5k1|k1~fk1|k1~4l1|k2 PRB_PST)

    1056

    (PRB_PST 1|2035 Update1| PRB_PST)

    1056

    (PRB_PST ~fk1|80;0;0~3k402|5~2k402|5~1k1|80;0;0~5l402|5Line1~dl1|k2~ck1|5~bl1|k1~1bk1|k1~1ak1|k1~19k1|k1~18l1|4100~17l1|20~16k1|k1~14k1|k3~12k1|k1~11l1|k2~10l1|k2~13k1|k1~1fm1|5FRONT~1ck1|30~15k1|5~1dm1|5FRONT~21m1|30~88k1|31~87k1|31~98k1|31 PRB_PST)

    1056

    (PRB_PST 1|2056 GCodeBlock1| PRB_PST)

    1056

    (PRB_PST 1|2017 Cycle2| PRB_PST)

    1056

    (PRB_PST ~8l1|250~am1|31~9l2|5SampleProbe~3l1|25~2k1|23~1l1|23~1fk1|74#40701?0.25~1ek1|74#40A01?0.25~1dk1|74#40B01?0.25~1ck1|74#40C01?0.25~1al1|73#1?6?0?0.05?-0.05#1?6?0?0.05?-0.05#1?6?0?0.05?-0.05~1bl1|72#1?6?0?1?-1~19l1|71#1?6?0?0.05?-0.05~14k1|5~13k1|k1~16k1|4100~15k1|4100~2bk1|74#40601?0.25~2ak1|74#40501?0.25~20l1|74#40101?0.25~28m1|5FRONT PRB_PST)

    1056

    (PRB_PST 1|F20B0BEA08 Length_Diameter1| PRB_PST)

    1056

    (PRB_PST ~4k1|5Fanuc~3k1|5TOOLSETTING_CUSTOMMACRO~2k1|5 CM_B1 ~1k1|59862~cl1|30~bl1|5137~1fk1|30~1el1|k2~1dk1|20~1cl1|k1~1bk1|33150~1al1|k2~19k1|25~18l1|k2~17k1|k1~16k1|20~15l1|k1~14l1|k1~27k1|25~2cl1|k1~26k1|20~28l1|k1~25k1|20~24l1|k1~23k1|20~22l1|k1~21k1|30~29l1|k1~20k1|20~2bl1|k1~2dk1|31 PRB_PST)

    1056

    (PRB_PST RENGCODE_START6 PRB_PST)

    1056

    (PRB_PST G91G28Z0. PRB_PST)

    1056

    (PRB_PST RENGCODE_END PRB_PST)

    1056

    (PRB_PST PRB_PST)

    1056

    (PRB_PST PP_END_OF_PROBING_OPERATION_DATA PRB_PST)

    1056

    (PRB_PST PP_START_OF_NC_OP PRB_PST)

    1043

     

    1042

     

    999

    150 0 9

    1051

    Generic 4X Mill

    1053

    toolpath group 1

    1008

    Cycle1

    1011

    0. 0. 0. 0. 0. 0. 0. 0. 0. 0.

    1012

    2 0 0 0 0 0 0 0 0 0

    1013

    0 6. 3. 0 1 0. 0. 0. 25 C:\DOCUMENTS AND SETTINGS\ALL USERS\DOCUMENTS\SHARED MCAMX6\MILL\TOOLS\LOLLIPOP.MCX-6

    1014

    1. 0. 0. 0. 1. 0. 0. 0. 1.

    1016

    9 18 150 1 0. 0. 0. 41 0 1 4 0 0. 0 0 7 9 1

    1017

    1. 0. 0. 0. 1. 0. 0. 0. 1.

    950

    0 0 0 225 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

    1025

    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

    1027

    1. 0. 0. 0. 1. 0. 0. 0. 1. 0. 0. 0.

    1028

    0 0 0. 0. 1. 0. 0. 1. 0 0 0 0

    1029

    0. 0. 0. 0. 0. 0. 0. 0. 0. 0 0

    1020

    0. 0. 0. 65. 50. 35. 0 1. 0. 0. 0. 0 10000 ALUMINUM mm - 2024

    20010

    TOP

    20011

     

    20012

    TOP

    20013

     

    20014

    TOP

    20015

     

    20016

    ALUMINUM mm - 2024

    20017

     

    20018

    toolpath group 1

    20019

     

    20001

    Probe

    20002

    Renishaw

    20003

     

    20004

    0 18 0 2 6. 3. 0. 0. 0 0 0. 0. 0. 0 8 4 4.5 0.

    20006

    0 0. 0. 0. 0. 0. 0. 0.

    20007

    0. 6. 117. 100. 4.5 7. 17. 0 0. 0. 1

    20008

    0. 0. 1. 0 0. 0. 0 0. 0.

    20009

    0 0

    20800

    0.

    20600

    207 89D80AA4-054A-11DB-B30C-444553544200 "" "" Machine Base

    20600

    208 89D80AA6-054A-11DB-B30C-444553544200 "Y" "Y" VMC Y Axis

    20600

    209 89D80AA8-054A-11DB-B30C-444553544200 "X" "X" VMC X Axis

    20600

    210 89D80AAA-054A-11DB-B30C-444553544200 "" "" Mill Machine Table

    20600

    211 89D80AAC-054A-11DB-B30C-444553544200 "A" "A" VMC A Axis

    20600

    212 89D80AAE-054A-11DB-B30C-444553544200 "" "" Fixture/Holder

    20600

    213 AC0EE714-AA5D-11E1-863D-001FE2DFB895 "" "" Stock

    20600

    214 89D80AB0-054A-11DB-B30C-444553544200 "Z" "Z" VMC Z Axis

    20600

    215 89D80AB2-054A-11DB-B30C-444553544200 "" "" VMC Tool Spindle

    20600

    216 89D80AB4-054A-11DB-B30C-444553544200 "" "" Automatic Tool Changer

    20601

    225 89D80AC2-054A-11DB-B30C-444553544200 0 Default (1)

    20700

    0 0 0 0 0 0 0 0 0 0

    1001

    0 100 10 0 0 0 0 0 0. 0 0. 0. 9999999. 250. 250. 250. 0 0.

    0

    0 0. 0. 50. -2. 0

    1

    0 -41. 36. 50. 10. 0

    1

    0 -41. 36. 7. 11. 0

    1

    0 -41. 36. 3. -1. 0

    1

    0 -41. 36. 0.1 -1. 0

    1

    0 -41. 36. 3. -1. 0

    0

    0 -41. 36. 50. -2. 0

    0

    0 -41. 36. 50. -2. 0

    1

    0 -48.14432542 10.0317526 50. 10. 0

    1

    0 -48.14432542 10.0317526 2. 11. 0

    1

    0 -47.21080749 12.77739356 2. -1. 0

    1

    0 -48.14432542 10.0317526 2. -1. 0

    1

    0 -29.65916181 3.74679697 2. -1. 0

    1

    0 -28.72564389 6.49243793 2. -1. 0

    1

    0 -29.65916181 3.74679697 2. -1. 0

    1

    0 -11.1739982 -2.53815866 2. -1. 0

    1

    0 -10.24048028 0.2074823 2. -1. 0

    1

    0 -11.1739982 -2.53815866 2. -1. 0

    1

    0 7.3111654 -8.82311428 2. -1. 0

    1

    0 8.24468333 -6.07747332 2. -1. 0

    1

    0 7.3111654 -8.82311428 2. -1. 0

    1

    0 25.79632901 -15.10806991 2. -1. 0

    1

    0 26.72984694 -12.36242895 2. -1. 0

    1

    0 25.79632901 -15.10806991 2. -1. 0

    1

    0 44.28149262 -21.39302554 2. -1. 0

    1

    0 45.21501055 -18.64738458 2. -1. 0

    1

    0 44.28149262 -21.39302554 2. -1. 0

    0

    0 44.28149262 -21.39302554 50. -2. 0

    1043

     

    1003

    250. 250. 250.

    1042

     

    999

    151 0 0

    1056

    (PRB_PST PP_END_OF_NC_OP PRB_PST)

    1056

    (PRB_PST PP_PROBING_FOOTER_PLACEHOLDER PRB_PST)

    1043

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