Macro programming worth it? Thanks for insights
Close
Login to Your Account
Page 1 of 5 123 ... LastLast
Results 1 to 20 of 82
  1. #1
    Join Date
    Apr 2018
    Country
    UNITED STATES
    State/Province
    Texas
    Posts
    37
    Post Thanks / Like
    Likes (Given)
    3
    Likes (Received)
    2

    Default Macro programming worth it? Thanks for insights

    Hey all, I've been programming, mostly g/m code but with some/decent amount of Cad/cam experience. I have recently been thinking about Macro Programming.

    Im somewhat out of touch with what different shops are doing and I guess my general question is the title. Basically, in the high tech era we are all in, is there a benefit (monetary and efficiency wise) for me to take on the task of learning how to macro program.

    Thanks to all who give feed back. Any thoughts or criticism is greatly appreciated.

    SML

  2. #2
    Join Date
    May 2017
    Country
    UNITED STATES
    State/Province
    Minnesota
    Posts
    304
    Post Thanks / Like
    Likes (Given)
    223
    Likes (Received)
    162

    Default

    Absolutely. Most common application is for probing, but also for setting up mixed batch runs on a pallet fed mill or a Swiss, and for cutting families of parts. Oh, and serial number engraving. I once wrote a macro on commission that would engrave PN, date, SN in a line at specified angle, or on a specified arc, and/or projected on a specified cylinder. Lots of trig.

  3. Likes danrudolph liked this post
  4. #3
    Join Date
    Apr 2018
    Country
    UNITED STATES
    State/Province
    Texas
    Posts
    37
    Post Thanks / Like
    Likes (Given)
    3
    Likes (Received)
    2

    Default

    I have seen and understand a lot of evidence of probing. Make sense. I also follow the family of parts. I dont quite get the mixed batch or swiss application (not because its not useful, but i just dont get it. (does program switch back and forth and completion. i dont know application). The PN/date/SN....Ah i think i get it, tell the control to automatically update PN and redo with understood geometry of cylinder?.....

    So it seems like those are some useful and direct applications and deserve merit. All in all, and you did answer, but wanting to know if the big picture investment of learning macros would increase what I could bring to a shop upon hiring. If I had my own shop and a probe or families of part I can already see the value in it. Just wondering if the REST of INDUSTRY does??

  5. #4
    Join Date
    Mar 2016
    Country
    UNITED STATES
    State/Province
    California
    Posts
    282
    Post Thanks / Like
    Likes (Given)
    61
    Likes (Received)
    99

    Default

    mhajicek is correct, macros are very useful.

    Most of my macros are set-up applications and macros that insure that nothing goes wrong.

  6. Likes DKS liked this post
  7. #5
    Join Date
    May 2006
    Location
    Burlington, North Carolina
    Posts
    253
    Post Thanks / Like
    Likes (Given)
    209
    Likes (Received)
    100

    Default

    Absolutely worth learning to program macros. A job we do that comes to mind is one that I have to broach a shape on the outside of a part. I have to take a cut, rotate the C-axis 6.316 degrees and repeat. It's much easier (and shorter) to put the movements in a WHILE/DO loop than to write a four line move 57 times. It also makes it easier to edit. I only have to change what I need to in one place, rather than 57 places.

  8. Likes Philabuster liked this post
  9. #6
    Join Date
    May 2017
    Country
    UNITED STATES
    State/Province
    Minnesota
    Posts
    304
    Post Thanks / Like
    Likes (Given)
    223
    Likes (Received)
    162

    Default

    Quote Originally Posted by SmlG54 View Post
    Just wondering if the REST of INDUSTRY does??
    Depends on the individual. Some still don't see the value of CAM, more than three axes, or quality tooling. My take is learn everything you can, git gud, and if a shop will appreciate that then it's a job you want. If they don't care and just want you to shut up and push the button, you don't want the job.

  10. #7
    Join Date
    Jan 2014
    Country
    UNITED STATES
    State/Province
    Washington
    Posts
    2,959
    Post Thanks / Like
    Likes (Given)
    574
    Likes (Received)
    1487

    Default

    Quote Originally Posted by SmlG54 View Post
    ....I dont quite get the mixed batch
    Not sure if this is what was meant...

    I did a macro for a company that made their own product. All the lathe parts were made from the same stock. The operator only had to key in how many assemblies worth of parts were needed for the day. A Macro then determined how many times to run the first program then switch to the next program and run it so many times. Some of the parts were 1 piece per assembly and others were 2 pieces and one part needed 4 pieces.

  11. Likes mhajicek, Philabuster liked this post
  12. #8
    Join Date
    May 2017
    Country
    UNITED STATES
    State/Province
    Minnesota
    Posts
    304
    Post Thanks / Like
    Likes (Given)
    223
    Likes (Received)
    162

    Default

    Yup. Oh, and while we're at it, if you want to practice your macro programming safely, check it with NCPlot. I never could have written and debugged that serial macro I mentioned without it.

  13. #9
    Join Date
    Apr 2018
    Country
    UNITED STATES
    State/Province
    Texas
    Posts
    37
    Post Thanks / Like
    Likes (Given)
    3
    Likes (Received)
    2

    Default

    Quote Originally Posted by mhajicek View Post
    Depends on the individual. Some still don't see the value of CAM, more than three axes, or quality tooling. My take is learn everything you can, git gud, and if a shop will appreciate that then it's a job you want. If they don't care and just want you to shut up and push the button, you don't want the job.
    You said it well, I am of the same philosophy. I recently turned down a job and told the manager that "respectfully, it would be boring" (not the id cutting )

    Also, thanks vanc. That makes sense, in a really cool and practical way.

    I have already seen a need for macros in the short time at my new company. Family of parts and also this job that parts of "washers" but the length of the raw stock differs and was thinking about just having one variable (part length sticking out from jaws) and have the program insure no crashes happens.

  14. #10
    Join Date
    Apr 2018
    Country
    UNITED STATES
    State/Province
    Texas
    Posts
    37
    Post Thanks / Like
    Likes (Given)
    3
    Likes (Received)
    2

    Default

    Quote Originally Posted by mhajicek View Post
    Yup. Oh, and while we're at it, if you want to practice your macro programming safely, check it with NCPlot. I never could have written and debugged that serial macro I mentioned without it.
    NC plot is not free, but if Mit digital calipers cost 300$ then I should look at it as a tool worth purchasing. Thanks

  15. #11
    Join Date
    Feb 2007
    Location
    Boston MA
    Posts
    926
    Post Thanks / Like
    Likes (Given)
    253
    Likes (Received)
    703

    Default

    There's a lot you can do with macro programming. A shop I do work for uses macros to control all their NC programs. Basically, each tool is a macro that is called from the main program. This allows operators to easily re-run a single tool right from the control which is VERY useful when you want to adjust an offset and re-run a specific tool which cuts one feature, etc.

    Not to mention all the other stuff you do can (modular programming, adaptive programs, and much more).

    It's very useful to learn macro programming. I'd say macro programming has much MORE application in industry than it does in the small business or home shop.

  16. #12
    Join Date
    May 2008
    Location
    Gauteng, South Africa
    Posts
    1,250
    Post Thanks / Like
    Likes (Given)
    948
    Likes (Received)
    513

    Default

    Do it, don't hesitate. I am a small shop and 2 small macros (block centre and hole centre finding) have saved me loads of time. The rest of them that I have written have made my life easier.

    Think of not being able to use sub programs is the best way that I can explain the value of macro programming. Even just understanding how variables and their calculations work/react will be a big bonus in any shop in my opinion.

    If you are thinking about it get this book, Sorry! Something went wrong! I know that I have "advertised" it here a few times but it helped me to start understanding way easier and quicker than trying to bang my head on my own. Once you have gone through it think of it as a reference book that you can refer to anytime.

    Once you have the book (I think there are others that you can buy) start going through the sticky on this sub forum on macro programming. I tried without any previous knowledge and it was tough... till I bought the book and used the two of them hand in hand.

    Not sure if the link is working but it is "CNC programming using Fanuc custom Macro B" by S.K Sinha (A member here on PM)

  17. #13
    Join Date
    Feb 2018
    Country
    FRANCE
    Posts
    34
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    hi

    use macros as long as they don't reduce your buffer size, or as long as you are satisfied with the lower buffer size; you may use soubroutines instead of macros, so to avoid messing with the buffer size

    custom build macros, so to fully use the cnc capability

    you may call these custom macros from a CAM code, so to enhance the CAM output, because is simpler to edit a macro, rather than to edit a CAM post

    applications ( software ) :
    ... stand alone : for editing a CAM output, delivering a parametric thing, etc
    ... interfaced with the control :
    ...... passive : for example when loading a probe program
    ...... active : to change the way a program works, in real-time

  18. #14
    Join Date
    Jan 2014
    Country
    UNITED STATES
    State/Province
    Washington
    Posts
    2,959
    Post Thanks / Like
    Likes (Given)
    574
    Likes (Received)
    1487

    Default

    Quote Originally Posted by dany_boy View Post
    hi

    use macros as long as they don't reduce your buffer size, or as long as you are satisfied with the lower buffer size; you may use soubroutines instead of macros, so to avoid messing with the buffer size
    Could you explain this ^? My BS meter hit the peg when I read it.

    Sounds a lot like the idiot formerly known as "deadlykitten".

  19. Likes NAST555, aj, Booze Daily, twr liked this post
  20. #15
    Join Date
    May 2008
    Location
    Gauteng, South Africa
    Posts
    1,250
    Post Thanks / Like
    Likes (Given)
    948
    Likes (Received)
    513

    Default

    Quote Originally Posted by Vancbiker View Post
    Could you explain this ^? My BS meter hit the peg when I read it.

    Sounds a lot like the idiot formerly known as "deadlykitten".
    I though the same so looked at a few of his other posts... And it sure does smell of cat

  21. Likes twr liked this post
  22. #16
    Join Date
    Feb 2018
    Country
    FRANCE
    Posts
    34
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    Quote Originally Posted by Vancbiker View Post
    Could you explain this ^? My BS meter hit the peg when I read it.

    Sounds a lot like the idiot formerly known as "deadlykitten".
    language sunshine okuma controller requires storage space from the read-ahead

    if you are don't polite, next time i won't answer you ...

  23. #17
    Join Date
    Jan 2014
    Country
    UNITED STATES
    State/Province
    Washington
    Posts
    2,959
    Post Thanks / Like
    Likes (Given)
    574
    Likes (Received)
    1487

    Default

    Quote Originally Posted by dany_boy View Post
    ...okuma controller requires storage space from the read-ahead
    Well aware that OSP utilizes temp files in storage. IME that does not affect buffering ability. If you have a clip from an OSP programming manual describing otherwise please post that.

  24. Likes twr liked this post
  25. #18
    Join Date
    May 2006
    Location
    Burlington, North Carolina
    Posts
    253
    Post Thanks / Like
    Likes (Given)
    209
    Likes (Received)
    100

    Default

    And I thought it was just the smiley faces...

  26. #19
    Join Date
    Feb 2018
    Country
    FRANCE
    Posts
    34
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    Quote Originally Posted by Vancbiker View Post
    Well aware that OSP utilizes temp files in storage. IME that does not affect buffering ability. If you have a clip from an OSP programming manual describing otherwise please post that.
    buff size and buffering ability are differrent things; buffering ability is manifested longer if the buff size is larger, as long as there is no buffering prohibit code

    is enough to create a *.lib file pretty close to buffer size, so to create problems

    time scale for such stuff is arround 0.005 - 0.015 seconds / block; depends on actual scenario

    for an exact comparison, is possible to disable the read-ahead from parameters, etc

    i avoid such situations by using only soubroutines instead of macros, and no buffer prohibit codes ( if possible )

    truth is that few *.lib files have a size that can be compared to the 2mb, so the actual read-ahead size is more than enough to permit using general macros ... is good to be aware of this numbers, so to avoid a situation where the read-ahead is compromised

    using soubroutines instead of macros has almost same execution time, without affecting the read-ahead size

    a problem may appear if *.lib is close to 2mb and HiCut or Nurbs is used on a toolpath with high feed and small segments ( for example on a high resolution 3d, or when using deposition, or a laser head ) ... but for such cases is recomended to use the "S" type when selecting programs, and in this method no soubroutines are used, and only a *.lib of maximum 1.8mb is allowed ... so would you preffer only 0.2mb read-ahead ? this case is too particular, but not impossible

  27. #20
    Join Date
    Jan 2014
    Country
    UNITED STATES
    State/Province
    Washington
    Posts
    2,959
    Post Thanks / Like
    Likes (Given)
    574
    Likes (Received)
    1487

    Default

    Again, instead of posting a bunch BS, post a clip from an OSP programming manual describing this. When I worked for an Okuma distributor, we were told 100kB is the recommended minimum amount of storage space for OSP generated temporary data.


Tags for this Thread

Bookmarks

Posting Permissions

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