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:

end of file b axis commands


Recommended Posts

8 minutes ago, RustyG said:

ok I am unfamiliar with "white space" 

Go to File / options in the editor (Code Expert) and open nthe document settings at the top.

Check the white space box and it will show what all your "spaces" are. Dots are spaces, arrows are tabs.

Link to comment
Share on other sites
2 minutes ago, JParis said:

Well, I jusr made the edit in the post you shared...from what I understand this end of program

This is what I am getting

N1300 M98 P65341057
N1310 G28 B0.
N1320 (1/2 ENDMILL / ROUGH EXCESS STOCK OFF /Z+.01)
N1330 G90 G54.1 P31 X-1.3763 Y-2.0172 Z1.
N1340 M98 P65341057
N1350 G28 B0.
N1360 (1/2 ENDMILL / ROUGH EXCESS STOCK OFF /Z+.01)
N1370 G90 G54.1 P30 X-1.3763 Y-2.0172 Z1.
N1380 M98 P65341057
N1390 G28 B0.
N1400 (1/2 ENDMILL / ROUGH EXCESS STOCK OFF /Z+.01)
N1410 G90 G54.1 P29 X-1.3763 Y-2.0172 Z1.
N1420 M98 P65341057
N1430 M05
N1440 G91 G28 Z0.
N1450 G90
N1460 G28 B0.
N1470 M2

OKK 3X HMC_FANUC.zip

 

with this peof

 

peof$            #End of file for non-zero tool @end
      pretract
      #if swt_lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
      rotretflg = 1
     #pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$
      pbld, n$, *sg28, protretinc, e$
      rotretflg = 0
      #if swt_lock_codes = one & rot_on_x, pbld, n$, *slock, slockcomm, e$
      comment$
      if not(index), n$, sgabsinc, e$
      uninhibit_eof_probe$
      n$, "M2", e$
      mergesub$
      clearsub$
      mergeaux$
      clearaux$
      "%", e$

one problem with that is we have added the G90 to follow the G91 in our posts, if you look there is a G90 in between the G91 G28 B0 and the G28 B0 lines, therefore the B axis would not rotate, other than that it is working fine. your code seems quite different then what I get so I am sure something is different

Link to comment
Share on other sites
1 minute ago, nickbe10 said:

Just uncomment the lock un lock lines, remove the #s at the beginning. The post is not outputting those lines as long as they are "commented out"

I provided a zip2go on a previous comment, as far as I can tell I have made the exact edits you are talking about with no change, I don't know what the issue is.

Link to comment
Share on other sites

OK, you have M78 defined as axis lock

and M79 as axis unlock....are those correct?  if so, what's the M80

I'm here so far the M80 is confusing

N1370 G90 G54.1 P30 X-1.3763 Y-2.0172 Z1.
N1380 M98 P65341057
N1390 G28 B0.
N1400 (1/2 ENDMILL / ROUGH EXCESS STOCK OFF /Z+.01)
N1410 G90 G54.1 P29 X-1.3763 Y-2.0172 Z1.
N1420 M98 P65341057
N1430 M05
N1440 G91 G28 Z0.
N1450 M79 (UNLOCK)
N1460 G28 B0.
N1470 M78 (LOCK)
N1480 G90
N1490 M2

 

Link to comment
Share on other sites
2 minutes ago, JParis said:

OK, you have M78 defined as axis lock

and M79 as axis unlock....are those correct?  if so, what's the M80

I'm here so far the M80 is confusing

N1370 G90 G54.1 P30 X-1.3763 Y-2.0172 Z1.
N1380 M98 P65341057
N1390 G28 B0.
N1400 (1/2 ENDMILL / ROUGH EXCESS STOCK OFF /Z+.01)
N1410 G90 G54.1 P29 X-1.3763 Y-2.0172 Z1.
N1420 M98 P65341057
N1430 M05
N1440 G91 G28 Z0.
N1450 M79 (UNLOCK)
N1460 G28 B0.
N1470 M78 (LOCK)
N1480 G90
N1490 M2

 

my mistake, disregard the M80 those unlock codes you have are correct

Link to comment
Share on other sites

Okay lets dissect this post to help others understand what is going on.

You have this for the peof$:

peof$            #End of file for non-zero tool @end
      pretract
      if swt_lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
      rotretflg = 1
      #  pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$
      #pbld, n$, *sg28, "Y0.", protretinc, e$
      rotretflg = 0
      if swt_lock_codes = one & rot_on_x, pbld, n$, *slock, slockcomm, e$
      comment$
      if not(index), n$, sgabsinc, e$
      uninhibit_eof_probe$
      n$, "M2", e$
      mergesub$
      clearsub$
      mergeaux$
      clearaux$
      "%", e$

From there in the post it is then going to pretract and in that section we have this:

pretract        #End of tool path, toolchange @ret
      phsm_off
      sav_absinc = absinc$
      absinc$ = one
      #absinc$ = zero  #Absolute Retract, jaw
      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,
            [
            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
      if convert_rpd$ = one,
        [
        gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]
      else, gcode$ = zero
      pbld, n$, sccomp, *sm05, psub_end_mny, e$
      pbld, n$, sgabsinc, sgcode, [if gcode$ = 1, sgfeed], *sg28, "Z0.", [if gcode$ = 1, feed], scoolant, e$
      #pbld, n$, sgabsinc, *sgcode, [if gcode$ = 1, sgfeed], *sg49, "G80", "Z0.", [if gcode$ = 1, feed], scoolant, e$
      if swt_lock_codes = two & rotunlockflg,
        [
        pbld, n$, *slock, slockcomm, e$
        rotunlockflg = zero
        ]
#      if swt_lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
#       pbld, n$, *sg28, "X0." "Y0., protretinc, e$
#     if swt_lock_codes = one & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
      if abs(fmtrnd(cabs)) > 360 & nextop$ <> 1003 & not(index),
        [
        absinc$ = one  #Change back to incremental mode
        if swt_lock_codes = one, pbld, n$, *sunlock, sunlockcomm, e$
        rotretflg = 1
        pbld, n$, `sg28, protretinc, e$
        rotretflg = 0
        if swt_lock_codes = one & cuttype = 0, pbld, n$, *slock, slockcomm, e$
        ]
      absinc$ = sav_absinc
      coolant$ = sav_coolant
      pbld, n$, sgabsinc, e$ #Added for G90 output followng G91 command RG
      uninhibit_probe$

In there we have several places where the Lock and unlock codes could be called depending on different conditions statements. I don't think the pretract is even needed in the peof$ section. Following what the post is begin told to as part of this process we have to review every where the post is being told to process data. Now in both of these sections we have a *sunlock and *slock using the condition statement of swt_lock_codes equaling one to then output this code if there was not a * infront of them then they couldn't be output if they were not needed. We don't have different logic like a sav_b equals b$ check to do this. In all reality we have redundant calls here. The other problem is in the peof$ section the lock codes are still not deactivated.

From the output you are wanting from the original posting at the end you don't want a B0 output, but you do at each tool change? Or you don't want any B axis calls at the end of any tool change section" Or just end of program? If that is the case then I would remove the preretract from the peof$ section. I would uncomment the line that was modified from Z0 to Y0 and then see if that gives you output like you want. Then in the peof$ I would then start looking at what you want to do with regards to the lock and unlock sections. You are misunderstanding because of everything being called twice and working in the wrong sections of the post thinking you are working in the correct sections of the post. What I like to do is put my initials next to every post modification I make. I also like to copy a line I am modifying and leave the original like it was then comment it out in the post. If I need to remember or see what I did then the original information is there.

peof$            #End of file for non-zero tool @end
      #pretract #RDB Commented out to not get redudant outputs
      pbld, n$, *sg28, "Z0.0", e$ #RDB Changed to Z0 only output. 
      if swt_lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
      rotretflg = 1
      #  pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$
      #pbld, n$, *sg28, "Y0.", protretinc, e$
      pbld, n$, *sg28, "B0.0", e$ #RDB Changed to B0.0 only output. Repalce with "B0.0" with proretenic if you want the last B rotation used output. 
      rotretflg = 0
      if swt_lock_codes = one & rot_on_x, pbld, n$, *slock, slockcomm, e$
      comment$
      if not(index), n$, sgabsinc, e$
      uninhibit_eof_probe$
      n$, "M2", e$
      mergesub$
      clearsub$
      mergeaux$
      clearaux$
      "%", e$

      #Multi-post logic
      spath_in  = spathnci$ + snamenci$
      spath_set = spathpst$ + sset
      spath_out = spathnc$ + snamenc$ + sextdoc
      sparams = ssq + sdq + spath_in + sdq + sspace + sdq + spath_set + sdq + sspace + sdq + spath_out + sdq + ssq

Then I get the following posted code.

%
O0000 (T)
(MCX FILE  - SAMPLE.MCAM)
(PROGRAM   - T.NC)
(DATE      - APR-08-2022)
(TIME      - 1:00 PM)
(T1   - 0.75 SPOT DRILL      - H1   - D1   - D0.7500")
(T2   - 0.875 7/8 HEAVY DUTY TAPER DRILL - H2   - D2   - D0.8750")
(T3   - 1 INCH-8 TAPRH       - H3   - D238 - D1.0000")
(T4   - .3346 SUMITOMO 4XD CARBIDE DRILL - H4   - D476 - D0.3346")
(T5   - M10X1.5 SPIRAL FLUTE TAP - H5   - D5   - D0.3937")
G00 G94 G17 G20 G40 G80 G90
 
N1 T1(0.75 SPOT DRILL - TOOL 1)
M16
(SPOT DRILL G54 SIDE)
M79 (UNLOCK)
G00 G90 G54 B0. M78 (LOCK)
S407 M03
X-2. Y2.
G43 H1 Z3. M08
G98 G81 X-2. Y2. Z-.2 R.1 F2.04
G80
(SPOT DRILL G55 SIDE)
G55 X2. Y2. Z3.
G98 G81 X2. Y2. Z-.2 R.1 F2.04
G80 M09
M05
G91 G00 G28 Z0.
G90
M01
 
N2 T2(0.875 7/8 HEAVY DUTY TAPER DRILL - TOOL 2)
M16
(DRILL G54 SIDE)
M79 (UNLOCK)
G00 G90 G54 B0. M78 (LOCK)
S349 M03
X-2. Y2.
G43 H2 Z3. M08
G98 G83 X-2. Y2. Z-1.4912 R.1 Q.2 F1.75
G80
(DRILL G55 SIDE)
G55 X2. Y2. Z3.
G98 G83 X2. Y2. Z-1.4912 R.1 Q.2 F1.75
G80 M09
M05
G91 G00 G28 Z0.
G90
M01
 
N3 T3(1 INCH-8 TAPRH - TOOL 3)
M16
(TAP G54 SIDE)
M79 (UNLOCK)
G00 G90 G54 B0. M78 (LOCK)
X-2. Y2.
G43 H3 Z3. M08
M29 S66
G98 G84 X-2. Y2. Z-1.6 R.1 F8.25
G80
(TAP G55 SIDE)
G55 X2. Y2. Z3.
M29 S66
G98 G84 X2. Y2. Z-1.6 R.1 F8.25
G80 M09
M05
G91 G00 G28 Z0.
G90
M01
 
N4 T4(.3346 SUMITOMO 4XD CARBIDE DRILL - TOOL 4)
M16
(DRILL FOR M10 HOLES G56 B90)
M79 (UNLOCK)
G00 G90 G56 B90. M78 (LOCK)
S2397 M03
X-.625 Y2.9843
G43 H4 Z3. M08
G98 G81 X-.625 Y2.9843 Z-1.0693 R.1 F11.98
X-.625 Y1.0157
G80
G00 G91 G28 Z0.
G90
(DRILL FOR M10 HOLES G57 B270)
M79 (UNLOCK)
G00 G57 B270. M78 (LOCK)
X.625 Y2.9843
G43 H4 Z3.
G98 G81 X.625 Y2.9843 Z-1.0693 R.1 F11.98
X.625 Y1.0157
G80 M09
M05
G91 G00 G28 Z0.
G90
M01
 
N5 T1(0.75 SPOT DRILL - TOOL 1)
M16
(CHAMFER M10 HOLES BEFORE TAPPING G57 B270)
M79 (UNLOCK)
G00 G90 G57 B270. M78 (LOCK)
S407 M03
X.625 Y2.9843
G43 H1 Z3. M08
G98 G81 X.625 Y2.9843 Z-.2 R.1 F2.04
X.625 Y1.0157
G80
G00 G91 G28 Z0.
G90
(CHAMFER M10 HOLES BEFORE TAPPING G56 B90)
M79 (UNLOCK)
G00 G56 B90. M78 (LOCK)
X-.625 Y2.9843
G43 H1 Z3.
G98 G81 X-.625 Y2.9843 Z-.2 R.1 F2.04
X-.625 Y1.0157
G80 M09
M05
G91 G00 G28 Z0.
G90
M01
 
N6 T5(M10X1.5 SPIRAL FLUTE TAP - TOOL 5)
M16
(TAP M10 HOLES G56 B90)
M79 (UNLOCK)
G00 G90 G56 B90. M78 (LOCK)
X-.625 Y2.9843
G43 H5 Z3. M08
M29 S194
G98 G84 X-.625 Y2.9843 Z-.83 R.1 F11.4567
X-.625 Y1.0157
G80
G00 G91 G28 Z0.
G90
(TAP M10 HOLES G57 B270)
M79 (UNLOCK)
G00 G57 B270. M78 (LOCK)
X.625 Y2.9843
G43 H5 Z3.
M29 S194
G98 G84 X.625 Y2.9843 Z-.82 R.1 F11.4567
X.625 Y1.0157
G80 M09
G28 Z0.0
M79 (UNLOCK)
G28 B0.0
M78 (LOCK)
M2
%

Now I see a  possible problem with the Lock code being on the B index line with the tool change section and you noted that so if it work on the machine then great, but if not then separate back out after encase the machine gives you an alarm or doesn't clamp because the B move and clamp move are on the same line.

 

 

  • Like 1
Link to comment
Share on other sites
33 minutes ago, RustyG said:

I finally got it working correctly, there were some redundant calls in the post code. All is well now, thank you everyone for the help

 

Thank you for sharing a legal Mastercam file.

Illegal users hurt everyone and sorry the crooks think I am the meanest person on the face of the earth for calling them out, but such is life. 

  • Like 1
Link to comment
Share on other sites
5 hours ago, RustyG said:

I finally got it working correctly, there were some redundant calls in the post code.

Glad you got it working, I had to bail due to work demands.

If it were me (and it isn't) I would put the necessary code in peof and call that post block with the appropriate call from pretract.

Not only does it simplify pretract but it puts the end of file code in a different place (the place where it was meant to go).

Then you can do other things there. In my 4 ax posts, for instance, I have a table/tombstone positioning option and an angle call for convenient loading unloading (using Mi and Mr).

Always try to modify the original code so everything else in the original is still functioning in its original sequence. It just makes life easier in the long run.

 

  • Like 1
Link to comment
Share on other sites
On 4/15/2022 at 5:21 PM, nickbe10 said:

Glad you got it working, I had to bail due to work demands.

If it were me (and it isn't) I would put the necessary code in peof and call that post block with the appropriate call from pretract.

Not only does it simplify pretract but it puts the end of file code in a different place (the place where it was meant to go).

Then you can do other things there. In my 4 ax posts, for instance, I have a table/tombstone positioning option and an angle call for convenient loading unloading (using Mi and Mr).

Always try to modify the original code so everything else in the original is still functioning in its original sequence. It just makes life easier in the long run.

 

I agree, what I am finding is that the posts this company has were modified previous to me working here, I had to compare the post I was working on to an original post and remove a lot of redundant callouts and such, once I got that figured out I was able to add the additional coding necessary to make it all work. Now I am trying to fix one last thing and then it's done. For some reason this machine doesn't like standard program names such as O1234. I need the beginning of the program to look like this where the 0005 is the program name designated in mastercam. Wish me luck and thanks again for the help

%
<0005>(*PROGRAM DESCRIPTION OR NAME HERE* )

  • Like 2
Link to comment
Share on other sites
2 hours ago, RustyG said:

Now I am trying to fix one last thing and then it's done.

It's been a while since I did any "oddball" formatting, but I would review that possibility for your Prog. #, it's amazing what you can do with formatting.

The simplest tools are often the best, and if you can do it with formatting the chances of logic interference are minimal.

Good luck, well I think no need for that now...remember dialing in your post is a marathon.

  • Thanks 1
  • Like 1
Link to comment
Share on other sites
1 minute ago, nickbe10 said:

It's been a while since I did any "oddball" formatting, but I would review that possibility for your Prog. #, it's amazing what you can do with formatting.

The simplest tools are often the best, and if you can do it with formatting the chances of logic interference are minimal.

Good luck, well I think no need for that now...remember dialing in your post is a marathon.

Got the program number post issue fixed, hopefully that's it for a while. Take care man

  • Like 1
Link to comment
Share on other sites
fmt "<" 7   progno$  ">"   #Program number


    *progno$, e$

That will output the "Program Number" between the Left/Right arrow characters

        "<", no_spc$, sprogname$, no_spc$, ">", e$

Or, you can modify the output line in 'pheader$' to output the 'Program Name' between the Left/Right Arrow characters, like this...

fmt  "<" 7  progno$  ">"   #Program number


      *progno$, sopen_prn, sprogname$, sclose_prn, e$

That will output the "Program Number", followed by the "Program Name" as a comment...

  • Like 1
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...