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:

COMMENT AS CODE


Recommended Posts

Hey guy's, I'm using a rotary and I am limited in my Z axis travel, I can't rotate with the tool over the work piece, I must move it home and then rotate, so I've added the rotations as manual entry's but my post will not output  them as code, they're always output in parenthesis, needing to be edited to be obeyed, 

example:

(G0G91G28Z0)

(G0G91G28Y0)

G0G90G54A180.

Can someone please show me how to change this post to output comments as code, removing the parenthesis,

thank you.

here is the top portion of our post,

# Post Name           : MPMAZAKM
# Product             : MILL
# Machine Name        : GENERIC MAZAK
# Control Name        : GENERIC (M32/M-Plus/Fusion)
# Description         : GENERIC MAZAK EIA MILL POST
# 4-axis/Axis subs.   : YES
# 5-axis              : NO
# Subprograms         : YES
# Executable          : MP 9.13
#
# WARNING: THIS POST IS GENERIC AND IS INTENDED FOR MODIFICATION TO
# THE MACHINE TOOL REQUIREMENTS AND PERSONAL PREFERENCE.
#
# --------------------------------------------------------------------------
# Revision log:
# --------------------------------------------------------------------------
# Programmers Note:
# CNC 01/12/01 - Initial post setup v8.1
# CNC 01/09/02 - Initial post update for V9.0
# CNC 01/06/03 - Moved feed assignment below pcom_moveb to address bug w/feed in 4 axis
# CNC 02/04/03 - Initial post update for V9.1
# CNC 05/28/03 - Initial post update for V9.1SP1
# CNC 03/17/04  -  Added update to cc_pos and cutpos2 after each move.
#
# Axsys 9/5/08 - Fixed tap cycle coming up with another F that was not based on pitch <swk>
#                Also added aggregate head to control definition and logic for
#                turning canned drill cycles into long form for aggregate ops.
#
# Axsys 9/30/08  Binned for Hasp # 55907 and 117435
#
# Axsys 10/16/08 - Removed comment line at start of file.
#
# Axsys 04/09/21 - New post from 2000_stage post with special incremental rotary axis output  <jvw>
#
# --------------------------------------------------------------------------
# Features:
# --------------------------------------------------------------------------
# This post supports Generic Mazak EIA output for 3 and 4 axis milling.
# It is designed to support the features of Mastercam Mill V8.
#
# The Mazak requires eight character numeric program names with the EIA
# extension.
# If you are using a floppy disk for file I/O the program must reside in a
# sub-directory for the control to recognize it.
#
# Following Misc. Integers are used:
#
# 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
#
#Canned text:
#    Entering cantext on a contour point from within Mastercam allows the
#    following functions to enable/disable.
#    Cantext value:
#    1 = Stop = output the "M00" stop code
#    2 = Ostop =  output the "M01" optional stop code
#    3 = Bld on = turn on block delete codes in NC lines
#    4 = bLd 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) Disable 4 axis by setting the numbered question 164. to 'n'.
# 2) G54 calls are generated where the work offset entry of 0 = G54,
#    1 = G55, etc.
# 3) Metric is applied from the NCI met_tool variable.
# 4) 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.
# 5) 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.
# 6) Always avoid machining to the center of rotation with rotary axis!
# 7) Transform subprograms are intended for use with G54.. workshifts.
#
#Subprograms:
# All program output files are created using the 8 digit program number
# that is assigned.  You should name your NC file using the program number
# and padded to 8 digits for the file to be found by Mastercam and the
# editors.
#
#Mazak Notes:
# 1) G28 must be programmed with G0
# 2) See 'Mazak Parameter Settings' section below to match machine
#
# END_HEADER$
Link to comment
Share on other sites

thank you Colin, I have almost zero experience at this and am afraid I'm working in the wrong area according to your pcant_out directions, searching for pcant_out

took me here

pcant_1         #Canned text - output call
      cantext$ = cant_val1$
      pcant_out

I've been working here, I'm sure this is very elementary for you but am I in the wrong area?

# Tool Comment / Manual Entry Section
# --------------------------------------------------------------------------
ptoolcomment    #Comment for tool
      tnote = t$
      toffnote = tloffno$
      tlngnote = tlngno$
      pbld, n$, "(", pstrtool, *tnote, *toffnote, *tlngnote, *tldia$,")", e$

pstrtool        #Comment for tool
      if strtool$ <> sblank,
        [
        strtool$ = ucase(strtool$)
        pbld, n$, *strtool$, " "
        ]

pcomment$        #Comment from manual entry
      scomm$ = ucase (scomm$)
      if gcode$ = 1007, "(", scomm$, ")",e$
      else, pbld, n$, "(", scomm$, ")", e$
Link to comment
Share on other sites
On 4/10/2021 at 9:23 AM, 10LIONS said:

pcant_1 #Canned text - output call

cantext$ = cant_val1$

pcant_out <--- that's the post block your looking for. If it doesn't come up when you're searching the post, it's in the binned section and there's nothing you can do unfortunately.

 

Link to comment
Share on other sites
On 4/10/2021 at 8:23 AM, 10LIONS said:

I've been working here, I'm sure this is very elementary for you but am I in the wrong area?

Your Post, judging by the header has been, heavily edited.
As you can see the Comments for Manual Entry As Code is controlled by 
gcode$ = 1006.

pcomment2        #Comment from manual entry
      #1005 - As Comment
      #1006 - As Code
      #1007 - As Comment with output line, change at point
      #1026 - As Code with output line, change at point
      #1008 - Operation comment

Try searching for
if gcode$ = 1006
 Probably not the best situation to learn Post Editing as you will be learning whatever bad practices may or may not be lurking in this post....
Download a copy of MPmaster and work your way through Colin's online course, then come back to this problem....
Link to comment
Share on other sites

pcant_1         #Canned text - output call
      cantext$ = cant_val1$
      pcant_out

pcant_2         #Canned text - output call
      cantext$ = cant_val2$
      pcant_out

pcant_3         #Canned text - output call
      cantext$ = cant_val3$
      pcant_out

pcant_4         #Canned text - output call
      cantext$ = cant_val4$
      pcant_out

pcant_5         #Canned text - output call
      cantext$ = cant_val5$
      pcant_out

pcant_6         #Canned text - output call
      cantext$ = cant_val6$
      pcant_out

pcant_7         #Canned text - output call
      cantext$ = cant_val7$
      pcant_out

pcant_8         #Canned text - output call
      cantext$ = cant_val8$
      pcant_out

pcant_9         #Canned text - output call
      cantext$ = cant_val9$
      pcant_out

pcant_10        #Canned text - output call
      cantext$ = cant_val10$
      pcant_out

pcant_out       #Canned text - build the string for output
      #Assign string select type outputs
      if cantext$ = three, bld = one
      if cantext$ = four, bld = zero
      #Build the cantext string
      if cantext$ = one, strcantext = strcantext + sm00
      if cantext$ = two, strcantext = strcantext + sm01
      if cantext$ > four,
        [
        strtextno = no2str(cantext$)
        strcantext = strcantext + strm + strtextno
        ]

[STARTBIN]

Thanks Kalibre, Colin, is this what you were looking for? 

Link to comment
Share on other sites
  • 2 weeks later...

Try here <<<<<<<< . I didn't test this but it's worth a try. Your comment may be turned on and code may be turned off.

 

pcomment2       #Comment from manual entry
      spaces$ = 0
      scomm$ = ucase (scomm$)
      #1005 - Comment option 1
      #1006 - Comment option 2
      #1007 - Define comment with output line
      #1008 - Define NC parameter comment
      #1026 - ?
      if gcode$ = 1005, pbld, pspc, "(", scomm$, ")"
      #if gcode = 1006, pbld, pspc, "(", scomm, ")"  #Comments <<<<<<<< # sign at the beginning means line is turned off.
      if gcode$ = 1006, pbld, n$, scomm$  #Codes  <<<<<<<<<<< no # sign at the beginning means turned on
      if gcode$ = 1007, "(", scomm$, ")"
      if gcode$ = 1008, pbld, pspc, "(", scomm$, ")"
      if gcode$ = 1026, pbld, scomm$
      if gcode$ <> 1007 & gcode$ <> 1026, e$
      spaces$ = sav_spc

 

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