Understanding FANUC Macro B Variables
What exactly is a G-code variable? In this video tutorial by @GCodeTutor, we are going to provide a simple explanation and show some examples of how to use them correctly.
When we are programming with G-code, many FANUC controls these days come with macro B programs enabled, and that allows us to use variables in our programming.
But what exactly is a variable? In a nutshell, a variable is a symbol for a number we don't know yet. They are the backbone of all programming languages. In the world of G-code, variables are expressed in the program by a hash symbol followed by a number, like in the example below
# 100 = 1
So we can give variables a number or a value, so if we state # 100 = 1, every variable # 100 in the program will equal 1.
Variables can also be used to do math within G-code. Variables math is often used to count cycles by adding a simple code like this "# 100 = # 110 + 1" at the bottom of every block of the program so that it adds 1 to the variable # 100 every time it gets to that point of the program.
By giving a value to a variable, we define the variable, and there are multiple ways to do that. We can add it manually into the register of the machine controls or we can change the value of the variables inside our NC program.
To learn more about FANUC macro B variables, visit Gcodetutor.com (https://rb.gy/7yzqfn).
Stay tuned for more machining videos!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Recommended CNC programming books:
Fanuc CNC Custom Macros - https://amzn.to/370yX0P
CNC Programming Handbook - https://amzn.to/2MPxT9g
CNC Programming Techniques - https://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 (https://www.practicalmachinist.com/)
Like us on Facebook (https://www.facebook.com/PracticalMachinist)
Follow us on Instagram (https://www.instagram.com/practicalmachinist/)
Follow us on Twitter (https://twitter.com/prac_machinist)
Connect with us on LinkedIn (https://www.linkedin.com/company/practical-machinist)
#FANUC #Gcode #CNCprogramming
Видео Understanding FANUC Macro B Variables канала Practical Machinist
When we are programming with G-code, many FANUC controls these days come with macro B programs enabled, and that allows us to use variables in our programming.
But what exactly is a variable? In a nutshell, a variable is a symbol for a number we don't know yet. They are the backbone of all programming languages. In the world of G-code, variables are expressed in the program by a hash symbol followed by a number, like in the example below
# 100 = 1
So we can give variables a number or a value, so if we state # 100 = 1, every variable # 100 in the program will equal 1.
Variables can also be used to do math within G-code. Variables math is often used to count cycles by adding a simple code like this "# 100 = # 110 + 1" at the bottom of every block of the program so that it adds 1 to the variable # 100 every time it gets to that point of the program.
By giving a value to a variable, we define the variable, and there are multiple ways to do that. We can add it manually into the register of the machine controls or we can change the value of the variables inside our NC program.
To learn more about FANUC macro B variables, visit Gcodetutor.com (https://rb.gy/7yzqfn).
Stay tuned for more machining videos!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Recommended CNC programming books:
Fanuc CNC Custom Macros - https://amzn.to/370yX0P
CNC Programming Handbook - https://amzn.to/2MPxT9g
CNC Programming Techniques - https://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 (https://www.practicalmachinist.com/)
Like us on Facebook (https://www.facebook.com/PracticalMachinist)
Follow us on Instagram (https://www.instagram.com/practicalmachinist/)
Follow us on Twitter (https://twitter.com/prac_machinist)
Connect with us on LinkedIn (https://www.linkedin.com/company/practical-machinist)
#FANUC #Gcode #CNCprogramming
Видео Understanding FANUC Macro B Variables канала Practical Machinist
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
How to Hand Program a Bushing on a CNC Lathe PART 3Taking Your Turning to the Next Level with BISON USAHYPNOTIC MACHINING | Slow motion machining compilationCutting Titanium With Sandvik's CoroMill Dura end millThe Machines That Make the Cutting ToolsDo you know how to program Peck Drill on a CNC lathe? #cnc #gcode #peckdrillingPractical Machinist Live from IMTS 2018 - Tooling Hall Part 1How to Respond to a Stubborn Boss | Machine Shop Talk Ep. 56Making a undercut in vise jaws with ballnose endmillHow to Hand Program a Bushing on a CNC Lathe - PART 6: Parting OffGWS: Where Custom Comes StandardHow to Leave a Shop the Right Way | Machine Shop Talk Ep. 57IMTS 2018 in 60 seconds or lessIs This The Best Solution to Engrave Electrodes?Adding Additive To Your Machining Capabilities with PHILLIPS HYBRIDThe Tools that Make Your Tools with ANCAA little slow mo drilling for your timeline🤩Behind the Scenes of the American Precision MuseumEverything Swiss Tooling! Checking out iSwiss Booth at EASTECFrom Machining Electrodes to Final EDM Burn with MC Machinery SystemsOh the great debate 🤣👀