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:

Using 'opinfo' to store POCO grab position


Recommended Posts

Hello all. This is my first posting but I've been gleaming knowledge from this forum for quite some time. So a belated thank you is due. What I'm trying to do is grab and store my POCO grab position which is param 13212, and then use that number in basically a comment at the beginning of the program. I've tried several different combinations of strategies I've learned from the MP Post Documentation and cannot get it to post anything other than the dreaded '-9999.' Any help would be greatly appreciated.

Link to comment
Share on other sites
37 minutes ago, M.Bluedorn said:

Hello all. This is my first posting but I've been gleaming knowledge from this forum for quite some time. So a belated thank you is due. What I'm trying to do is grab and store my POCO grab position which is param 13212, and then use that number in basically a comment at the beginning of the program. I've tried several different combinations of strategies I've learned from the MP Post Documentation and cannot get it to post anything other than the dreaded '-9999.' Any help would be greatly appreciated.

Throw up your logic attempt and see what you have laid out as a an attempt and someone should be able to guide you.

Please make sure to post up like so using the insert code so someone can see the proper spacing and such that is paramount with MP.

# --------------------------------------------------------------------------
#Format Assignments and Initializations
# --------------------------------------------------------------------------
fmt "Z" 2 stck_init_z$           #Initial Z position of the stock (900-902,904,905)
fmt "Z" 2 stck_final_z$          #Final Z position of the stock (900-902,904,905)
fmt "Z" 2 stck_chuk_st_z$        #Initial Z axis Chuck Position (900-903)
fmt "X" 2 stck_chuk_st_x$        #Initial X axis Chuck Position (900-903)
fmt "Z" 2 stck_chuk_end_z$       #Final Z axis Chuck Position (900-903)
fmt "X" 2 stck_chuk_end_x$       #Final X axis Chuck Position (900-903)
fmt "B" 3 stck_chuk_st_dz$       #Destination chuck Z axis reference position before transfer (900)
fmt "U" 3 stck_chuk_st_dx$       #Destination chuck X axis reference position before transfer (900)
fmt "B" 3 stck_chuk_end_dz$      #Destination chuck Z axis reference position after transfer (900)
fmt "U" 3 stck_chuk_end_dx$      #Destination chuck X axis reference position after transfer (900)
fmt "Z" 2 stck_clear$            #Stock clearance value for stock pull operation (902)
fmt "X" 2 stck_tool_x$           #Tool X axis position for bar stop / puller (902)
fmt "Z" 2 stck_grip$             #Grip length value for stock pull operation(902)

fmt "F" 18 stck_adv_fr$          #Used with Lathe Stock Advance (Bar-Feed/Pull) function (NCI 902)
fmt "F" 18 stck_appr_fr$         #Used with Lathe Stock Advance (Bar-Feed/Pull) function (NCI 902)

#Flags
stck_op$         : 0             #Stock advance operation method (902)
                                #(0=Push stock,1=Push stock with Use Tool Stop option,2=Pull stock)
stck_spindle$    : 0             #Active spindle with stock to transfer (900-902)
                                #0=Left Spindle,1=Right Spindle
clmp_op$         : 0             #The selected Operation mode: 0=Clamp,1=Un-clamp,2=Re-position (903)
clmp_spindle$    : 0             #Active spindle for clamp/unclamp 0=Left Spindle,1=Right Spindle (903)
tlstck_on$       : 0             #Retract or engage the tailstock (0=Retract,1=Engage) (904)

toolend_flg     : 1             #Flag to execute ptoolend sequence or not
transfer        : 0

fmt "T" 4 miscops_mi1$      #Tool call
fmt "B" 2 miscops_mr1$      #sub rapid point
fmt "B" 2 miscops_mr2$      #sub feed point
fmt "Z" 2 miscops_mr3$      #tool move point


fmt "B" 2 subreturn         #Initial Z axis Chuck Position (900-903)
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
#Postblock Section -comments only!
# --------------------------------------------------------------------------
pstck_trans$     #NCI code = 900 available variables:
                #stck_spindle, stck_init_z, stck_final_z,
                #stck_chuk_st_z, stck_chuk_st_x,
                #stck_chuk_end_z, stck_chuk_end_x,
                #stck_chuk_st_dz, stck_chuk_st_dx,
                #stck_chuk_end_dz, stck_chuk_end_dx
                if toolchng <> two, ptoolend$
                toolend_flg = zero  #Do not execute ptoolend again after xfer
                [
#                 !spaces$
#                 spaces$ = zero
#                 pbld, n$, "M00",e$
#                 if prv_spaces$ > 0, " ",e$
#                 if stck_spindle$ = 0, "(Xfer Part from Left Spindle)", e$
#                 if stck_spindle$ = 1, "(Xfer Part from Right Spindle)", e$
#                 spaces$ = prv_spaces$
                ]

      !spaces$
      spaces$ = zero

      *e$
      if stck_chuk_st_dz$ = stck_chuk_end_dz$,
       [
       pbld, n$, "(CHUCK RETRACT ONLY)", e$
       transfer = 2
       ]
      else,
       [
       pbld, n$, "(TRANSFER)", e$                #Transfer program
       transfer = 1
       ]

      if transfer = 1,
        [
        toolchng = 1
        pbld, n$, pwcs, e$
        toolchng = 0

        if miscops_mi1$,    #No output of tool or motion if no tool selected
          [
          toolno = miscops_mi1$
          if omitseq$ = 1 & tseqno > 0,
            [
            if tseqno = 2, n$ = int(miscops_mi1$ / 100)
            pbld, *n$, *toolno, "(CUTOFF TOOL, MISC INT 1)", e$
            ]
          else, pbld, n$, *toolno, "(CUTOFF TOOL, MISC INT 1)", e$
          pbld, n$, "G0", *miscops_mr3$, "(TOOL RAPID POSITION, MISC REAL 3)", e$  #MOVE TO POSITION
          ]


        pbld, n$, "(OPEN SUB HERE)", e$

        pbld, n$, "G0", *miscops_mr1$, "(SUB RAPID POSITION, MISC REAL 1)", e$           #sub rapid to position

        if miscops_mi2$,
          [
          pbld, n$, "G1G98", *miscops_mr2$, "(SUB FEED POSITION, MISC REAL 2)", "F50.", e$     #sub feed to position
          pbld, n$, "(TORQUE SKIP MODE ON HERE)", e$    #torque skip
          pbld, n$, "(TORQUE SKIP CODE HERE)G98", *stck_chuk_end_dz$, "F30.", "(SUB PICK-OFF POSITION)", e$     #sub feed to position
          #Usually there's a macro here to check if it's within tolerance of the theoretical position
          ]
        else, pbld, n$, "G1G98", *stck_chuk_end_dz$, "F50.", "(SUB PICK-OFF POSITION)", e$


        pbld, n$, "G4", "U500", e$           #dwell
        pbld, n$, "(CLOSE SUB HERE)", e$              #close sub
        pbld, n$, "G4", "U500", e$            #dwell

        if stck_init_z$ <> stck_final_z$,
          [
          #output this little section if you want motion before the cutoff
          pbld, n$, "(OPEN MAIN HERE)", e$
          pbld, n$, "G4U500", e$  #
          subreturn = (stck_final_z$ - stck_init_z$) + stck_chuk_end_dz$
          pbld, n$, "G1G98", *subreturn, "F50.", "(SUB RETRACT POSITION)", e$  #This could be a G28 or a # macro variable also
          pbld, n$, "(CLOSE MAIN HERE)", e$  #(MAINCLOSE)
          pbld, n$, "G4U500", e$  #
         ]
       ]


           #Cutoff code goes here


      if transfer = 2,
        [
        pbld, n$, "G55", "G0", "B0.", "(SETUP SUB RETURN HOME)", e$    #Assuming G55 and B0 is set at home, this could be a G28 or a # macro variable
        pbld, n$, "M01", e$
        *e$
        ]

      spaces$ = prv_spaces$

 

Link to comment
Share on other sites
1 hour ago, M.Bluedorn said:

Hello all. This is my first posting but I've been gleaming knowledge from this forum for quite some time. So a belated thank you is due. What I'm trying to do is grab and store my POCO grab position which is param 13212, and then use that number in basically a comment at the beginning of the program. I've tried several different combinations of strategies I've learned from the MP Post Documentation and cannot get it to post anything other than the dreaded '-9999.' Any help would be greatly appreciated.

Part handling operations don't have tool change lines.  The lack of a tool change means that opinfo doesn't 'see' part handling operations in it's offset(default) mode.  This means that you need to read the operation stream to look at all the operations.

If you have questions about this I recommend you contact your reseller or post on CNC Software's forum.  

  • Like 1
Link to comment
Share on other sites

Upon doing some digging and talking to my post guy at our Mastercam reseller, it is looking like even attempting to grab the parameter for any use at all would be not available as they have binned all of the POCO part of our paid post. I was unaware this was a thing until today while I was trying to figure this out. Needless to say I have a lot to learn still.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

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