Subs

Started by Flycut, January 13, 2022, 06:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Flycut

I've got a few things I'd like to modify in my post and this is the one I think might be the simplest to start with.


N1
(ROUGH 0.72 HOLES)
(T28    - 3/8 FLAT ENDMILL)
T28 M06
G00 G17 G90 G54
S4500 M03
A0.
M08
X51.19 Y0.
G43 H28 Z4.54
M97 P0001

(ROUGH 0.72 HOLES)
G00 A-22.5
X50.315
M97 P0002

(ROUGH 0.72 HOLES)
G00 A-45.
X51.19
M97 P0001

(ROUGH 0.72 HOLES)
G00 A-67.5
X50.315
M97 P0002

I would like my sub-routines to be numbered 100, 200, 300 rather than 1 2 3
Anyone care to point me in the right direction?

My post is IKE_HAAS_VF_4AXIS

JParis

The changes are so drastic in the IKE posts, I haven't had time to dig into them but in my post I control it in this manner

in the section

psub_call_trans

at the bottom of it...
absinc$ = sav_absinc
      #result = nwadrs(strp, main_prg_no$)
      result = nwadrs(strh, main_prg_no$)    #altered to get H output, 02/10/2020, jmp
      main_prg_no$ = main_prg_no$ + 40000   #alter to push subprograms #'s into the 40000 range, 02/10/2020, jmp    <---------
      #if progno$ = main_prg_no$, result = mprint(sprgnerror)
      pbld, n$, "M98", *main_prg_no$, e$
      result = force(feed)  # Force output of feed next time it's called for output (in sub)

Flycut

What would I lookfor if I wanted sub-routines rather than sub-programs?

JParis

Glancing through the IKE post...

In the same section I noted above...the edit looks to be this line

pbld, pn, *smsub_call, *main_prg_no$, pe, pms

Flycut

Thanks JP

But this is the result I get.

13 Jan 2022 08:17:40 AM - Post processor execution initialized.
13 Jan 2022 08:17:40 AM - Unencrypted input file:
13 Jan 2022 08:17:40 AM - C:\Users\Public\Documents\Shared Mastercam 2020\mill\Posts\IKE_HAAS_VF_4AXIS.psT
13 Jan 2022 08:17:40 AM - Encrypted input file:
13 Jan 2022 08:17:40 AM - C:\Users\Public\Documents\Shared Mastercam 2020\mill\Posts\IKE_HAAS_VF_4AXIS.psb
13 Jan 2022 08:17:40 AM - Loading input files was successful.
13 Jan 2022 08:17:41 AM - Initialization of pre-defined post variables, strings, postblocks was successful.
13 Jan 2022 08:17:41 AM - Search for defined post variables, strings, postblocks was successful.
13 Jan 2022 08:17:42 AM - PST LINE (3660,3660) - The post block output type processing has failed!, , Label was expected but was not found[43], Illegal character(s) encountered
13 Jan 2022 08:17:42 AM - Successful completion of post processor execution.


N1
(ROUGH 0.72 HOLES)
(T28    - 3/8 FLAT ENDMILL)
T28 M06
G00 G17 G90 G54
S4500 M03
A0.
M08
X51.19 Y0.
G43 H28 Z4.54
M97 P0001 d

(ROUGH 0.72 HOLES)
G00 A-22.5
X50.315
M97 P0002 d

(ROUGH 0.72 HOLES)
G00 A-45.
X51.19
M97 P0001 d

JParis

What does your edit look like?

Flycut


# --------------------------------------------------------------------------
# SUBPROGRAM POST BLOCKS
# --------------------------------------------------------------------------
psub_call_m$            #Call to main level, single tool
      psub_call_trans

psub_call_mm$           #Call to main level, multiple tools
      psub_call_trans

psub_call_trans         #Translate level calls from tool change, user
      sav_absinc = absinc$

      #Mirror or Rotate Coord's
      if sub_trnstyp$ = 0 | (sub_trnstyp$ = 1 & mr_rt_actv),
        [
        #The original pattern is not mirrored or rotated
        if sub_sec_no$,
          [
          absinc$ = 0
          if sub_trnstyp$, psub_rotate
          else, psub_mirror
          ]
        mr_rt_actv = 3
        ]
      else,                                                          #Translate
        [
        if sub_mny_t$,
          [
          pbld, pn, pwcs, pe, pms
          punlock
          pbld, pn, pfsgcode, psgfeed, pfsgabsinc, pftiltout, pfrotout, pvecout, pffeed, pe, pms
          plock
          pbld, pn, psgcode, psgfeed, psgabsinc, pfxout, pfyout, pfeed, pe, pms
          pbld, pn, psgcode, psgfeed, psgabsinc, pfzout, pfeed, pe, pms
          pe_inc_calc
          ps_inc_calc
          ]
        ]
      result = nwadrs(strp, main_prg_no$)
      pbld, pn, *smsub_call, *main_prg_no$ + 100, pe, pms    <----------------

psub_mirror             #Mirror start code, user
      #Mirror Y axis
      if sub_trnmthd$, pbld, pn, pfsgabsinc, sgtrns_mir_on, *sub_trnsx$, pe, pms
      #Mirror X axis
      else, pbld, pn, pfsgabsinc, sgtrns_mir_on, *sub_trnsy$, pe, pms

JParis

Try this instead

  result = nwadrs(strp, main_prg_no$)
      main_prg_no$ = main_prg_no$ + 100
      pbld, pn, *smsub_call, *main_prg_no$, pe, pms

Flycut

Thanks JP
That did it.

JParis


Flycut

I decided to tackle this one on my own and I think I got it right.
I'd just feel a little better if somebody gave me a thumbs up in case I did a faux pas.

peof$                   #End of file for non-zero tool
      eof_flg = 1
      pretract
      comment$
      pms_eof
      pn, smeof, pe, pms
      #seof_char, pe, pms <------ blocked this line

      mergesub$
      clearsub$
      seof_char, pe, pms <------ copied it here
      mergeaux$
      clearaux$

      psus_toollist
      psus_build

      eof_flg = 0

This now puts the % at the end of the subs rather than the M30.
I hope that's all it does.