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:

N BLOCK


Recommended Posts

Hello all ,I need fix some thing in my post 

I can get N block  an T number in same line ,haw I can fix this ??

 

sample my program 

(COMPENSATION TYPE - COMPUTER)
N1 T1
M06 (1/2 FLAT ENDMILL)
(MAX - Z7.2211)
(MIN - Z.91)
G57 H901
G00 G17 G90 B90. X-.2857 Y-.1003

 

 

 

 

my post 

# Tool Comment / Manual Entry Section
# --------------------------------------------------------------------------
ptoolcomment    #Comment for tool
      tnote = t$
      toffnote = tloffno$
      tlngnote = tlngno$
      tldianote = tldia$
      spaces$ = 0
      scomm_str, pstrtool, " ", *tnote, " ", *toffnote, " ", *tlngnote, " ", *tldianote, scomm_end, e$
      spaces$ = sav_spc

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

thank you for any help 

 

Link to comment
Share on other sites
5 minutes ago, mirek1017 said:

Hello all ,I need fix some thing in my post 

I can get N block  an T number in same line ,haw I can fix this ??

 

sample my program 

(COMPENSATION TYPE - COMPUTER)
N1 T1
M06 (1/2 FLAT ENDMILL)
(MAX - Z7.2211)
(MIN - Z.91)
G57 H901
G00 G17 G90 B90. X-.2857 Y-.1003

 

 

 

 

my post 

# Tool Comment / Manual Entry Section
# --------------------------------------------------------------------------
ptoolcomment    #Comment for tool
      tnote = t$
      toffnote = tloffno$
      tlngnote = tlngno$
      tldianote = tldia$
      spaces$ = 0
      scomm_str, pstrtool, " ", *tnote, " ", *toffnote, " ", *tlngnote, " ", *tldianote, scomm_end, e$
      spaces$ = sav_spc

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

thank you for any help 

 

MPMASTER has this built into it.

tseqno      : 0     #Output sequence number at toolchanges when omitseq = yes
                    #0=off, 1=seq numbers match toolchange number, 2=seq numbers match tool number

Follow the logic used in that post.

ptlchg_com
section removed

      if stagetool >= zero,
        [
        if omitseq$ = 1 & tseqno > 0,
          [
          if tseqno = 2, n$ = t$
          pbld, *n$, *t$, "M06", ptoolcomm, e$
          ]
        else, pbld, n$, *t$, "M06", ptoolcomm, e$
        ]

pheader$
section removed

      if tseqno = 1 & omitseq$ = 1,
        [
        seqno$ = 1
        seqinc$ = 1
        n$ = seqno$
        ]

 

  • Like 1
Link to comment
Share on other sites
25 minutes ago, crazy^millman said:

MPMASTER has this built into it.

tseqno      : 0     #Output sequence number at toolchanges when omitseq = yes
                    #0=off, 1=seq numbers match toolchange number, 2=seq numbers match tool number

Follow the logic used in that post.

ptlchg_com
section removed

      if stagetool >= zero,
        [
        if omitseq$ = 1 & tseqno > 0,
          [
          if tseqno = 2, n$ = t$
          pbld, *n$, *t$, "M06", ptoolcomm, e$
          ]
        else, pbld, n$, *t$, "M06", ptoolcomm, e$
        ]

pheader$
section removed

      if tseqno = 1 & omitseq$ = 1,
        [
        seqno$ = 1
        seqinc$ = 1
        n$ = seqno$
        ]

 

 

 I am missing something  ,this is my post  

 

 

 

 if stagetool >= zero,
        [
        if omitseq$ = 1 & tseqno > 0,
          [
          if tseqno = 2, n$ = t$
          pbld, *n$, *t$, e$
          pbld, n$, "M06", ptoolcomm, e$
          ]
        else,
          [
          pbld, n$, *t$, e$
          pbld, n$, "M06", ptoolcomm, e$
          ]
        ]
      spaces$=0
      if output_z = yes$,
 

 

 

 

 

Link to comment
Share on other sites
5 minutes ago, mirek1017 said:

 

 I am missing something  ,this is my post  

 

 

 

 if stagetool >= zero,
        [
        if omitseq$ = 1 & tseqno > 0,
          [
          if tseqno = 2, n$ = t$
          pbld, *n$, *t$, e$
          pbld, n$, "M06", ptoolcomm, e$
          ]
        else,
          [
          pbld, n$, *t$, e$
          pbld, n$, "M06", ptoolcomm, e$
          ]
        ]
      spaces$=0
      if output_z = yes$,
 

 

 

 

 

Not in that section of the post. Download MPMASTER and use it to reverse engineer what is missing in your post. I am a teacher of the idea if I do al the work for you then you will not learn how to figure it our for yourself.

Link to comment
Share on other sites
6 minutes ago, crazy^millman said:

What did the base post start life from? Need to know to see what the Tool Change Logic looks like.

 

[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V25.00 P0 E1 W25.00 T1663592119 M25.00 I0 O0
# Post Name           : MPM TOSHIBA HMC.PST
# Product             : MILL
# Machine Name        : TOSHIBA BTD/BTH/HM/HBM SERIES
# Control Name        : TOSNUC 777/888/999
# Description         : TOSHIBA 4 AXIS VMC
# 4-axis/Axis subs.   : YES
# 5-axis              : NO
# Subprograms         : YES
# Executable          : MP v11.0
# Post Revision       : 11.2.07337 (MC_FULL.MC_MINOR.YYDDD)
#
# WARNING: THIS POST IS GENERIC AND IS INTENDED FOR MODIFICATION TO
# THE MACHINE TOOL REQUIREMENTS AND PERSONAL PREFERENCE.
 

 

 

 

 

 

# --------------------------------------------------------------------------
# Start of File and Toolchange Setup
# --------------------------------------------------------------------------
psof0$           #Start of file for tool zero
      psof$

psof$            #Start of file for non-zero tool number
      probe_head$
      ptravel
      pwritbuf5
      pcuttype
      toolchng = one
      if ntools$ = one,
        [
        #skip single tool outputs, stagetool must be on
        #stagetool = m_one
        !next_tool$
        ]
      tooltotal = rbuf(4,0)  #Reads total tool and null tool changes
      if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)
      else, nexttool = first_tool$

      if tool_table = 2, ppredstck
      if tool_table = 3, pmetastck

      spaces$=0
      if output_z = yes$ & tcnt > 1,
        [
        scomm_str, "OVERALL MAX - ", *z_tmax, scomm_end, e$
        scomm_str, "OVERALL MIN - ", *z_tmin, scomm_end, e$
        ]
      spaces$=sav_spc

      if plane$ < 0 | opcode$ = 3 | opcode$ = 16, plane$ = 0
      pbld, n$, *sgcode, *sgplane, "G40", "G80", *sgabsinc, e$
      pbld, n$, "G53", e$
      inhibit_probe$
      sav_absinc = absinc$
      absinc$ = one
      if wcstype <= one, #Work coordinate system
        [
        pfbld, n$, sgabsinc, *sg28, "Z0.", e$
        pfbld, n$, *sg28, "X0.", "Y0.", e$
        pfbld, n$, "G92", *xh$, *yh$, *zh$, e$
        ]
      else,
        [
        pbld, n$, sgabsinc, *sg28, "Z0.", e$
        ]
      absinc$ = sav_absinc
      sav_mi9 = mi9$
      sav_workofs = workofs$
      if sav_workofs < 0, sav_workofs = 0
      ptlchg_com
      sof = 0

ptlchg_com      #Tool change common blocks
      if force_output | sof,
        [
        result = force(ipr_type,ipr_type)
        result = force(absinc$,absinc$)
        result = force(plane$,plane$)
        ]
      pcom_moveb
      pcheckaxis      #Check for valid rotary axis
      if sof, uninhibit_probe$
      c_mmlt$ #Multiple tool subprogram call
      #ptoolcomment
      if sof & scomm_sav <> snull,
        [
        spaces$ = 0
        n$, pspc, scomm_str, *scomm_sav, scomm_end, e$
        spaces$ = sav_spc
        ]
      if sof = 0, scomm_sav = snull

      if mi3$,
        [
        result = nwadrs(strw,zabs)
        result = nwadrs(strw,zinc)
        result = nwadrs(strz,mi1$)
        ]
      else,
        [
        result = nwadrs(strz,zabs)
        result = nwadrs(strz,zinc)
        result = nwadrs(strw,mi1$)
        ]

      comment$
      pcomment3
      pmisccheck
      pcan
      if stagetool >= zero,
        [
        if omitseq$ = 1 & tseqno > 0,
          [
          if tseqno = 2, n$ = t$
          pbld, *n$, e$
          pbld, *t$, e$
          pbld, n$, "M06", ptoolcomm, e$
          ]
        else,
          [
          pbld, n$, 
          pbld, *t$, e$
          pbld, n$, "M06", ptoolcomm, e$
          ]
        ]
      spaces$=0
      if output_z = yes$,
        [
        preadbuf5
        if (opcode$ > 0 & opcode$ < 16) | opcode$ = 19,
          [
          n$, pspc, scomm_str, "MAX - ", *max_depth, scomm_end, e$
          n$, pspc, scomm_str, "MIN - ", *min_depth, scomm_end, e$
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

That looks like it started like as a MPMASTER based post.

Look for this section in the ptlchng_com

      if safe_index,
        [
        if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
        pbld, n$, pgear, e$
        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], pfcout, strcantext, e$
        if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        pbld, n$, sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, pfspindleout, [if gcode$ = 1, *feed], e$
        ]
      else,
        [
        if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
        pbld, n$, pgear, e$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
          pfspindleout, [if gcode$ = 1, *feed], strcantext, e$
        if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        ]

If that is identical then easy change. If not then you need to look for the section that has pfcout, ppfxout, pfyout on the same line. This is the line combining them all for output together. In the MPMASTER original post that is this line:

        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
          pfspindleout, [if gcode$ = 1, *feed], strcantext, e$

I always try to copy any original line or lines in a postr and comment them out. Then make modification to the copied lines to see what works. I ever need to go back to the original stuff then easy as uncommenting the original lines and commenting out the copied lines. FYI # is what we call a comment line in MP post. Anything seen after the # sign is ignored and considered comments.

#        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
#          pfspindleout, [if gcode$ = 1, *feed], strcantext, e$
        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, dfspindleout, [if gcode$ = 1, *feed], strcantext, e$ #changed to break out X and Y on a seperate line RDB 12-28-22
        pcan1, pbld, n$, *sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, [if gcode$ = 1, *feed], e$ #changed to break out X and Y on a seperate line RDB 12-28-22

Here is how I would break it out and test. I would see what it does and then modify as needed for the output I am getting. I always try to add my initials to any post mod. That way anyone else can know I did it and I also try to give a brief reason for the post mod.

Link to comment
Share on other sites
2 minutes ago, crazy^millman said:

That looks like it started like as a MPMASTER based post.

Look for this section in the ptlchng_com

      if safe_index,
        [
        if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
        pbld, n$, pgear, e$
        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], pfcout, strcantext, e$
        if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        pbld, n$, sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, pfspindleout, [if gcode$ = 1, *feed], e$
        ]
      else,
        [
        if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
        pbld, n$, pgear, e$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
          pfspindleout, [if gcode$ = 1, *feed], strcantext, e$
        if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        ]

If that is identical then easy change. If not then you need to look for the section that has pfcout, ppfxout, pfyout on the same line. This is the line combining them all for output together. In the MPMASTER original post that is this line:

        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
          pfspindleout, [if gcode$ = 1, *feed], strcantext, e$

I always try to copy any original line or lines in a postr and comment them out. Then make modification to the copied lines to see what works. I ever need to go back to the original stuff then easy as uncommenting the original lines and commenting out the copied lines. FYI # is what we call a comment line in MP post. Anything seen after the # sign is ignored and considered comments.

#        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
#          pfspindleout, [if gcode$ = 1, *feed], strcantext, e$
        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, dfspindleout, [if gcode$ = 1, *feed], strcantext, e$ #changed to break out X and Y on a seperate line RDB 12-28-22
        pcan1, pbld, n$, *sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, [if gcode$ = 1, *feed], e$ #changed to break out X and Y on a seperate line RDB 12-28-22

Here is how I would break it out and test. I would see what it does and then modify as needed for the output I am getting. I always try to add my initials to any post mod. That way anyone else can know I did it and I also try to give a brief reason for the post mod.

 

 

 

if safe_index,
        [
        if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
        pbld, n$, pgear, e$
        pcan1, pbld, n$, *sgcode, sgplane, sgabsinc, pfcout, strcantext, e$
        if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        pbld, n$, sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, [if gcode$ = 1, *feed], e$
        #pbld, n$, pfspindleout, e$
        ]
      else,
        [
        if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
        pbld, n$, pgear, e$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        pcan1, pbld, n$, *sgcode, sgplane, sgabsinc, [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
          [if gcode$ = 1, *feed], strcantext, e$
          #pbld, n$, pfspindleout, e$
        if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

It looks identical now up to you to take what I have showed you and apply it to that section of the post. You also notice I used the code section for putting up this information. By using that is keeps the spacing format correct when posting it on the forum. It was missed by nerds like me that want to see proper spacing for computer language information.

Link to comment
Share on other sites
12 minutes ago, crazy^millman said:

That looks like it started like as a MPMASTER based post.

Look for this section in the ptlchng_com

      if safe_index,
        [
        if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
        pbld, n$, pgear, e$
        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], pfcout, strcantext, e$
        if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        pbld, n$, sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, pfspindleout, [if gcode$ = 1, *feed], e$
        ]
      else,
        [
        if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
        pbld, n$, pgear, e$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
          pfspindleout, [if gcode$ = 1, *feed], strcantext, e$
        if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        ]

If that is identical then easy change. If not then you need to look for the section that has pfcout, ppfxout, pfyout on the same line. This is the line combining them all for output together. In the MPMASTER original post that is this line:

        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
          pfspindleout, [if gcode$ = 1, *feed], strcantext, e$

I always try to copy any original line or lines in a postr and comment them out. Then make modification to the copied lines to see what works. I ever need to go back to the original stuff then easy as uncommenting the original lines and commenting out the copied lines. FYI # is what we call a comment line in MP post. Anything seen after the # sign is ignored and considered comments.

#        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
#          pfspindleout, [if gcode$ = 1, *feed], strcantext, e$
        pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, dfspindleout, [if gcode$ = 1, *feed], strcantext, e$ #changed to break out X and Y on a seperate line RDB 12-28-22
        pcan1, pbld, n$, *sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, [if gcode$ = 1, *feed], e$ #changed to break out X and Y on a seperate line RDB 12-28-22

Here is how I would break it out and test. I would see what it does and then modify as needed for the output I am getting. I always try to add my initials to any post mod. That way anyone else can know I did it and I also try to give a brief reason for the post mod.

 

 

 

if safe_index,
        [
        if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
        pbld, n$, pgear, e$
        pcan1, pbld, n$, *sgcode, sgplane, sgabsinc, pfcout, strcantext, e$
        if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        pbld, n$, sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, [if gcode$ = 1, *feed], e$
        #pbld, n$, pfspindleout, e$
        ]
      else,
        [
        if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
        pbld, n$, pgear, e$
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        pcan1, pbld, n$, *sgcode, sgplane, sgabsinc, [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
          [if gcode$ = 1, *feed], strcantext, e$
          #pbld, n$, pfspindleout, e$
        if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
 

 

 

 

NEW

 

      #  pcan1, pbld, n$, *sgcode, sgplane, sgabsinc, [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,
          [if gcode$ = 1, *feed], strcantext, e$
pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, dfspindleout, [if gcode$ = 1, *feed], strcantext, e$ #changed to break out X and Y on a seperate line RDB 12-28-22
        pcan1, pbld, n$, *sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, [if gcode$ = 1, *feed], e$ #changed to break out X and Y on a seperate line RDB 12-28-22
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites
T1
M06 (1/2 FLAT ENDMILL)
(MAX - Z7.2211)
(MIN - Z.91)
G57 H901
B90.
G17 G90 Z1.4211
X-.2857 Y-.1003
G94 G01 Z1.1928 F150.

NEW

I am not sure ,the G173  W  value missing 

Just now, crazy^millman said:

No you didn't do both lines. That is 2 lines when you put a # on the first line it needs to now be on both since the post is not seeing the first complete line. Does the post give you an error?

 

 

yes

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