Shorten Your G-Code Using a WHILE Loop! | CNC Macro Programming Tutorial

  Рет қаралды 18,169

Practical Machinist

Practical Machinist

3 жыл бұрын

‪@GCodeTutor‬ demonstrates how to remove a large amount of material writing only 9 lines of G-code.
As we saw in other videos in this series of CNC programming tutorials, Macro B variables are a great way to simplify your G-code programs and make them easier to read and modify.
In this video, Marc Cronin shows how to write a Macro program using a WHILE loop.
To learn more about G-code and CNC macro programming, visit Gcodetutor.com (rb.gy/7yzqfn).
Stay tuned for more machining videos!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Recommended CNC programming books:
Fanuc CNC Custom Macros - amzn.to/370yX0P
CNC Programming Handbook - amzn.to/2MPxT9g
CNC Programming Techniques - amzn.to/3aTS4el
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Practical Machinist is the largest and most engaged metalworking community across the web. With more than 160,000 registered members and 300,000+ social media followers, Practical Machinist is the easiest way to learn new techniques, get answers quickly, and discuss common challenges with your peers. Visit Practical Machinist today to join the community and start connecting with your peers.
Become a Practical Machinist member (www.practicalmachinist.com/)
Like us on Facebook ( / practicalmachinist )
Follow us on Instagram ( / practicalmachinist )
Follow us on Twitter ( / prac_machinist )
Connect with us on LinkedIn ( / practical-machinist )
#Gcode #CNCprogramming #macroprogramming

Пікірлер: 9
@lcmac4765
@lcmac4765 3 жыл бұрын
You guys are like free school. Thanks for all the info
@iliandimitrov4857
@iliandimitrov4857 2 ай бұрын
These examples are very helpfull indeed, thank you!
@faradynemotors9147
@faradynemotors9147 2 жыл бұрын
I usually use go-to subs for that sort of thing with G91 moves, but this technique seems like it is a good tool to have in the box of tools to use. I've heard some folks get wound up about mixing G90 & G91 but the fella that taught me G-code basics 30 years ago used both routinely without thinking much about it.
@---MarcosVanzuita---
@---MarcosVanzuita--- 9 ай бұрын
Muito shoy este tutorial de repetição do WHILE...... Parabéns!👏👍
@somethingelse4424
@somethingelse4424 Жыл бұрын
I kept having a 1 in 100 intermittent tool change issue where the machine would throw tools randomly against the walls, fixture, parts, etc. Maintenance wouldn't believe me--they'd watch it do ten tool changes and walk away. So then the machine would throw a drill randomly, nobody would notice, then try to bore a non existent hole, and have a cascading effect of tool destruction and scrap material. I eventually wrote a while loop that would do a continuous (user specified) loop of tool changes to prove I wasn't crazy. Well it worked, but it blew the thermal breaker on the ATC system almost immediately and I just about shit myself thinking I destroyed the machine. Lucky it just took a hard reset and was fine. I added a G04 dwell between tool changes before I showed off my fancy macro to anyone. Be careful, and always test your code with a variety of inputs.
@KoenBrader
@KoenBrader 3 жыл бұрын
Why do you count down? Isn’t there a “less than” or “less than or equal” ann increment to that?
@rfigueroa93rf
@rfigueroa93rf 3 жыл бұрын
You can write which ever which way you’d like to orient your positives and negatives. But using absolute positioning, and with your Y0 at the top left, it makes more sense to leave it moving DOWN by 10. Hence the minus. In summary, it’s best if you choose a system and stick to it. Up and right= positive, down and left= negative.
@Bagginsess
@Bagginsess 3 жыл бұрын
I wonder why the programming language enigneers didn't use "" for "LT" like in other programming languages.
@somethingelse4424
@somethingelse4424 Жыл бұрын
That would make way more sense to me too. The most reasonable answer I can come up with is that the < and > symbols don't exist on fanuc controllers pre-macro era. However the brackets [ ] also didn't have a pre-macro language use... So that kind of torpedoes my theory that all the characters making up LT GT GE EQ all had existing uses prior to "complex" macro logic. Having had a little C++ and VB experience before getting into GCODE, that also frustrates me. Maybe brackets were the bare minimum addition to the keypad to enable higher logic, as parenthesis would be interpreted as comments. They could get by with using E Q L T G without adding keys and losing backwards compatibility.
CNC Macro Programming Tutorial: IF Statements
5:33
Practical Machinist
Рет қаралды 15 М.
Gym belt !! 😂😂  @kauermtt
00:10
Tibo InShape
Рет қаралды 16 МЛН
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 12 МЛН
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 8 МЛН
G & M Code - Advanced Manual Programming Trick - TITANS of CNC Vlog #51
16:12
TITANS of CNC MACHINING
Рет қаралды 225 М.
WHILE DO LOOP IN A CNC MILL PROGRAM
10:27
Tom Stikkelman
Рет қаралды 66 М.
Secret Art of MACRO PROGRAMMING on a CNC Machine | G-Code Genius
12:03
TITANS of CNC MACHINING
Рет қаралды 106 М.
Basic Movements with G-Code
8:32
Practical Machinist
Рет қаралды 62 М.
Hot-Rush Jobs: THREE THINGS You Need to Know | Machine Shop Talk Ep.115
13:19
Use M99 To Loop, Jump, and Return! - Haas Automation Tip of the Day
7:56
Haas Automation, Inc.
Рет қаралды 84 М.
Programming CNC Macros - Part 1
11:00
CamInstructor
Рет қаралды 67 М.
Programming CNC Macros - Part 2
19:40
CamInstructor
Рет қаралды 26 М.
Новые iPhone 16 и 16 Pro Max
0:42
Romancev768
Рет қаралды 1,4 МЛН
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 3,1 МЛН
iPhone 15 Pro Max vs IPhone Xs Max  troll face speed test
0:33