588,099 active members*
5,216 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > BobCad-Cam > Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?
Results 1 to 13 of 13
  1. #1
    Join Date
    Oct 2009
    Posts
    254

    Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    Hey guys,

    I have a question in regards to adding in G & M codes after posting your BC code. For instance, I have to enter an M code in for the Haas thru spindle coolant On/Off. How can re-sequence the line numbers so they are in order if I have to manually add code? Thankfully this step was toward the end, so I manually re-keyed the line line numbers in. I tried with Predator and adding a sequence number but it just added a sequence number that was already used and also out of sequence (see below).

    Example: M88 to turn on TSC

    (TOOL #10 Badger UNC 5/8-11 Hand Tap)
    N499 T10 M06
    N500 T13
    M88 <-------- NEED TO ADD A SEQUENCE NUMBER BUT HOW TO YOU RE-SEQUENCE AFTER YOU ADD? This would become N501 the next line needs to be N502 and so on.
    N501 G90 G54 X1.5 Y2.1275 S98 M03


    Predator did this:

    (TOOL #10 Badger UNC 5/8-11 Hand Tap)
    N499 T10 M06
    N500 T13
    N510 M88 <------ OUT OF SEQUENCE AND N510 IS ALREADY USED
    N501 G90 G54 X1.5 Y2.1275 S98 M03



    Thanks for the help.

  2. #2

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    If you delete a block of code does your machine run what's left without errors?
    If so could you modify your post to change the line number increment from 1 to 5 thus leaving yourself gaps in the numbering for line insertion?

  3. #3
    Join Date
    Jun 2008
    Posts
    1838

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    Couple of ways to fix this, either go to your Milling Job settings and set the Posting numbers to 10 instead of 1, that way all your lines of code will be 10 digits apart ie N500, N510, N520 etc, that gives you spaces in between to insert any modifications required, I generate all my code this way, make for a much simpler life

    Probably the best way is to modify your PP so that it outputs the M88 for you correctly by using an "Advanced Posting" PP, if you can`t do that then if you are using a HAAS VF PP go look at blocks :-

    706 Coolant Mist Code? "M07"
    707 Coolant Air Code? "M07"
    708 Coolant Oil Code? "M07"

    You should be able to change one of the "M07" commands that you never use to the "M88" for example the 706 Mist block, then you can set all your Through Tool Coolant tools with the Mist option, that should then automatically produce the M88 whenever you choose a Through Tool Coolant tool

    Or you can just select the Mist option on your tool information area in any given feature

    Hope that is of some help to you

    Regards
    Rob
    :rainfro: :rainfro: :rainfro:

  4. #4
    Join Date
    Jul 2008
    Posts
    70

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    Quote Originally Posted by The Engine Guy View Post
    Couple of ways to fix this, either go to your Milling Job settings and set the Posting numbers to 10 instead of 1, that way all your lines of code will be 10 digits apart ie N500, N510, N520 etc, that gives you spaces in between to insert any modifications required, I generate all my code this way, make for a much simpler life

    Probably the best way is to modify your PP so that it outputs the M88 for you correctly by using an "Advanced Posting" PP, if you can`t do that then if you are using a HAAS VF PP go look at blocks :-

    706 Coolant Mist Code? "M07"
    707 Coolant Air Code? "M07"
    708 Coolant Oil Code? "M07"

    You should be able to change one of the "M07" commands that you never use to the "M88" for example the 706 Mist block, then you can set all your Through Tool Coolant tools with the Mist option, that should then automatically produce the M88 whenever you choose a Through Tool Coolant tool

    Or you can just select the Mist option on your tool information area in any given feature

    Hope that is of some help to you

    Regards
    Rob
    :rainfro: :rainfro: :rainfro:
    That is a good plan
    but the haas don't need sequence numbers
    that just for the guy running the machine to have a place to jump
    into a program. why would they jump in at a M88 line?
    they will jump in at a safe start point

  5. #5
    Join Date
    Apr 2008
    Posts
    1577

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    If you only need one coolant on at a time, Rob's solution is by far the easiest way to go about it. You can use the drop down menu in the feature for coolant options and it should post the correct code (never tried it myself).

    The other alternative is scripting the output, also as Rob mentioned

    I assume you don't want it to come on all the time so you're going to need add an Advanced Posting tab to all of the features you want to use it on, or create one "shared" posting page as explained in the Documentation folder of the BobCAD-CAM Data Vxx folder:

    .CustomDrillCycles
    All Mill Hole Drilling Operations
    .CustomMilling
    All non-hole Milling operations (2 Axis-through-Multiaxis)

    Add a checkbox (TSC On) in the .CustomMilling/.CustomDrillCycles file so that you can use a program_block_x call in the post to read it right after your tool change or in Block 4 (null tool change). Probably in multiple places, really.

    Then I would add the TSC off (M89) manually (hard code it) at each tool change and at the end of file. I don't think you need to be fancy and set a conditional off switch, if you are using TSC for a certain tool you'll probably be using it throughout the use of the tool.

    The program_block_x is probably going to be pretty simple. Something like an if/then statement. If checked then output M89 else donothing. I always do the "donothing" or something similar just to test the script. Once you are sure it's going to work you can always delete it out later. Or not, it's just a simple one line comment.

  6. #6
    Join Date
    Oct 2009
    Posts
    254

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    Hi guys,

    Didn't even realize I had these great responses. For some reason, I don't always get the email alerts when someone posts. In this instance, I only had an alert from 'magicniner' above. I guess I haven't tried it without sequence number on my added code as mentioned by WILDMAN2. I could test and see if the Haas errors out.

    Great ideas. Rob, both ideas are great. Either would satisfy my needs if not both. As a test, I changed the Oil "708" to be an M88 and sure enough it posted just as I needed it. The only thing I would need to do is manually add the M89 to shut the spindle coolant off like SBC Cycle said.
    I guess I could certainly do a combination of the 2 ideas by change the sequence number increments and change the 708. The only caveat is if I wanted to do TSC & flood the same time. As a test I did this:

    708. Coolant Oil code? "M88 M08"

    It actually did post both coolants as you can see: N05 G43 H1 D1 Z1. M88 M08

    I only need to manually add the M89 prior to the next tool change. The M09 does post on its own to shut off normal coolant.

    SBC, you obviously know your post modifications But you are correct, we don't want TSC all the time as not all our tooling supports it. I may need to personally get with you to help me out. It sound like that is another great long term solution.

    Thank you, much appreciated. The solution I tested is pretty much effortless. In all honest for the little code that I would ever add in the near future, changing the sequence number to increment by 10 instead of 1 and do a little data entry, would be fine. Didn't even know this ability was possible.

  7. #7
    Join Date
    Oct 2009
    Posts
    254

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    By the way, I haven't physically tested this yet to see if you can have 2 M codes on the same line: N05 G43 H1 D1 Z1. M88 M08

  8. #8
    Join Date
    Dec 2013
    Posts
    290

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    The post notification emails only trigger for the first reply to your subscribed posts since your last visit to the forum. So if you get a email notice, and visit another section of the forum, it resets and will send you a notice with the next post to that thread.


    The way bobcad has gone about making their post processors is by far their best hidden feature in my opinion. They are the easiest post processors to edit that I have come across. Its saved me quite a bit of time in hand edits, being that I can easily tweak the posts for each machine.

    And if you have support, and need your post to do something obscure, their team can do just about anything you can think of. My CNC at home was setup to output the spindle speed 0-100%, rather then the RPM output. I had bobcad make me a post that did the calculation for my spindle speed. I later found out that I could change the min/max RPM settings in my CNC Controller, so I no longer need the custom post.
    Work: Hurco VMX42/VMX50 - Shopsabre 4896 - Bobcad V4 4axis pro
    Home: RF45 with Ajax CNC Controller - Bobcad V27 3 axis pro

  9. #9
    Join Date
    Jun 2008
    Posts
    1838

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    Quote Originally Posted by Rotax91 View Post
    By the way, I haven't physically tested this yet to see if you can have 2 M codes on the same line: N05 G43 H1 D1 Z1. M88 M08

    Hmmm, that will be interesting, I don`t have any experience of HAAS controls so maybe you can have two M codes on the same line but it isn`t normally allowed on any control that I have come across so far

    Regards
    Rob
    :rainfro: :rainfro: :rainfro:

  10. #10
    Join Date
    Jun 2008
    Posts
    1838

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    Quote Originally Posted by Rotax91 View Post
    By the way, I haven't physically tested this yet to see if you can have 2 M codes on the same line: N05 G43 H1 D1 Z1. M88 M08
    OK, I have done a little bit of work on a simple Advanced PP for you, I`m not very good at this, really needs SBC on it if he has the time

    It does work here on my V28, but as I don`t know what version you are running (It`s probably in a post somewhere that I haven`t read properly ) I haven`t uploaded the BobCAD file

    Anyway I`ve attached thePP and the two Custom files in a Zip file, all you should need to do is to open the Zip and simply copy and paste the three files into your MillPst Folder in whatever Version you have.

    You can then open a new BobCAD drawing and set the PP in your tree to the new Custom.MillPst and road test it

    All the files you can open to view and edit in Notepad but always remember to just "Save" them, don`t do any "Save As" just for safety

    You can alter any PP (A copy of your HAAS one if you like) to output as the attached PP by just typing in any number/text you want to appear in your code line.



    I have also set up an M89 to cancel the M88 and it should work, if not then you might need to hand edit a little However if it is anything like my machines the unless the M88 command is already "Active" in the control it should ignore the M89 without any errors

    See the code below for a couple of pockets one with a finish and one without and a drill cycle, when you use the PP it will create an "Adv Posting" tab in your feature where you can select the correct type of coolant for every different tool

    (BEGIN PREDATOR NC HEADER)
    (MACH_FILE=3AXVMILL.MCH)
    (MTOOL T1 S1 D12.7 C0. A0. H127. HT1 HD1.5 HH.5 DIAM_OFFSET 1 = 6.35)
    (MTOOL T2 S1 D8. C0. A0. H127. HT1 HD1.5 HH.5 DIAM_OFFSET 2 = 4.)
    (MTOOL T3 S1 D10. C0. A0. H76.2 HT1 HD1.5 HH.5 DIAM_OFFSET 3 = 5.)
    (MTOOL T51 S4 D12.7 C0. A118. H152.4 HT1 HD1.5 HH.5 DIAM_OFFSET 51 = 6.35)
    (END PREDATOR NC HEADER)

    (PROGRAM NAME: BOBCAD1.NC)
    (DATE: TUE. 04/05/2016)
    (TIME: 09:52PM)

    N10 G90 G80 G40 G20 G17

    (POCKET 1)

    (TOOL #1 12.7 ENDMILL ROUGH)
    N20 T1 M06
    N30 S120 M03
    N40 M08
    N50 G54 X0.381 Y4.3815
    N60 G00 G43 H1 D1 Z25.4
    N70 Z5.08
    N80 Z2.54
    N90 G01 Z0. F35.5208
    N100 Z-12.7
    N110 Y0.381 F71.0417
    N120 X4.3815
    N130 Y4.3815
    N140 X0.381
    N150 Y10.7315
    N160 X-5.969
    N170 Y-5.969
    N180 X10.7315
    N190 Y10.7315
    N200 X0.381
    N210 G00 Z5.08
    N220 Z25.4

    (POCKET 2)

    N230 M05
    N240 M09
    N250 M89
    (TOOL #2 8. ENDMILL ROUGH)
    N260 T2 M06
    N270 M88
    N280 S191 M03
    N290 G54 X-0.319 Y5.082
    N300 G43 H2 D2 Z25.4

    N310 G00 Z5.08
    N320 Z2.54
    N330 G01 Z0. F56.3893
    N340 Z-12.7
    N350 Y-0.319 F112.7787
    N360 X5.082
    N370 Y5.082
    N380 X-0.319
    N390 Y9.082
    N400 X-4.319
    N410 Y-4.319
    N420 X9.082
    N430 Y9.082
    N440 X-0.319
    N450 X-4.319
    N460 Y13.082
    N470 X-6.35
    N480 G17 G03 X-8.319 Y11.113 R1.969
    N490 G01 Y-6.35
    N500 G03 X-6.35 Y-8.319 R1.969
    N510 G01 X11.113
    N520 G03 X13.082 Y-6.35 R1.969
    N530 G01 Y11.113
    N540 G03 X11.113 Y13.082 R1.969
    N550 G01 X-4.319
    N560 G00 Z5.08
    N570 Z25.4

    (POCKET 2)

    N580 M05
    N590 M09
    N600 M89
    (TOOL #3 10. ENDMILL FINISH)
    N610 T3 M06
    N620 M07
    N630 S153 M03
    N640 G54 X-7.7 Y11.113
    N650 G43 H3 D3 Z25.4

    N660 G00 Z5.08
    N670 Z2.54
    N680 G01 Z-12.7 F22.5557
    N690 Y-6.35 F45.1115
    N700 G17 G03 X-6.35 Y-7.7 R1.35
    N710 G01 X11.113
    N720 G03 X12.462 Y-6.35 R1.35
    N730 G01 Y11.113
    N740 G03 X11.113 Y12.462 R1.35
    N750 G01 X-6.35
    N760 G03 X-7.7 Y11.113 R1.35
    N770 G00 Z5.08
    N780 Z25.4

    (STANDARD FEATURE MILL HOLE - 12.7000)

    N790 M05
    N800 M09
    N810 M89
    (TOOL #51 12.7 DRILL)
    N820 T51 M06
    N830 M88
    N840 S120 M03
    N850 G54 X-16.598 Y16.919
    N860 G43 H51 D51 Z25.4

    N870 G00 Z5.08
    N880 G81 X-16.598 Y16.919 Z-16.515 R2.54 F8.8802
    N890 G80
    N900 Z5.08
    N910 G00 Z25.4

    N920 G53 Z0
    N930 G53 Y0
    N940 M05
    N950 M09
    N960 M89
    N970 M30
    %



    Best I can do for you with my limited expertise, as I said before SBC is the man for this stuff

    Regards
    Rob
    :rainfro: :rainfro: :rainfro:

  11. #11
    Join Date
    Oct 2009
    Posts
    254

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    Hi Rob,

    I really appreciate you taking all that time to help me out. This is great stuff. I see you got to post both M88 & M89. I want to try this out ASAP. I know where the Custom.MILLPST files goes but what folder do you drop the other 2 files into?

    A little while back, I made a modification to my post with some previous help. That change was to do a next tool precall. Made the cycle times quicker having the next tool on deck. I should be able to incorporation that code into your post.

    By the way, I do have V28.

    THANK YOU!!!

  12. #12
    Join Date
    Jun 2008
    Posts
    1838

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    All three files need to go into the same folder, ie your V28 MillPst folder, they have to be all in the same folder for it to work

    So that would be C:\BobCAD-CAM Data\BobCAD-CAM V28\Posts\Mill for most PCs

    Hope it works for you, it is one I had from a few years ago that I have modified to suit your requirements, not sure now but I think it was originally done by either SBC or Al, I can`t take the credit for the original, only the mods

    Regards
    Rob
    :rainfro: :rainfro: :rainfro:

  13. #13
    Join Date
    Apr 2008
    Posts
    1577

    Re: Adding in G/M codes after BobCAD post. How do you Re-Sequence the line numbers?

    Quote Originally Posted by The Engine Guy View Post
    All three files need to go into the same folder, ie your V28 MillPst folder, they have to be all in the same folder for it to work

    So that would be C:\BobCAD-CAM Data\BobCAD-CAM V28\Posts\Mill for most PCs

    Hope it works for you, it is one I had from a few years ago that I have modified to suit your requirements, not sure now but I think it was originally done by either SBC or Al, I can`t take the credit for the original, only the mods

    Regards
    Rob
    :rainfro: :rainfro: :rainfro:
    Just got time to look at it Rob, it works beautifully!

    Rotax91,
    If you need both coolants on at the same time you could add more conditions to the drop down menu such as "TSC On, Coolant Off" or "TSC On, Coolant On" and then modify the Case statement accordingly. However, I am in doubt about whether they can be on the same line in the Haas Control. I don't have the TSC option on any of my machines so I can't test it.

    If that is the case, you may need to re-add the normal coolant_on line somewhere in the Tool Change and Null Tool Change sections of the Post and control it normally in the Wizard dialog. It would probably be just fine if you added it right after the program_block:

    n,program_block_1
    n,coolant_on

    Very easy and simple script to follow. Good stuff!

    EDIT: To my knowledge it may have been our old friend "The Bird" that gave us all examples of how to use scripting. As soon as we had the ability to script our posts the first thing I asked for was an example of a simple coolant on, coolant off function. Coolant used to be hard coded into the post and there was no way to selectively turn it on or off. I run plastics as well as steel so that made it very easy to control without having to have two posts.

    FWIW I rarely use much scripting in my post anymore. The posting engine is now very mature and handles just about everything I need. But when you need it, you need it! Glad everyone is making use of this awesome feature.

Similar Threads

  1. Replies: 2
    Last Post: 07-31-2014, 06:44 PM
  2. POST 2 SEQUENCE NUMBER ON THE SAME LINE
    By MAINVIST in forum Post Processors for MC
    Replies: 3
    Last Post: 11-06-2013, 10:31 AM
  3. Replies: 3
    Last Post: 09-27-2013, 08:48 AM
  4. Line Numbers
    By qnet2 in forum Post Processors for MC
    Replies: 3
    Last Post: 12-08-2010, 04:39 PM
  5. Line numbers
    By batmill in forum G-Code Programing
    Replies: 11
    Last Post: 09-16-2007, 09:25 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •