2 Variable Techniques Understanding variables Variables in custom macro B Presentation links page for lesson two Arguments Local variables Common variables.

Slides:



Advertisements
Similar presentations
Variables in C Amir Haider Lecturer.
Advertisements

Setup Reduction For CNC Machining & Turning Centers Copyright 2001 Demo only – Most topics are not active!
Industrial Engineering Program King Saud University
CANNED CYCLES AND SUBROUTINES
Relates to machining and turning centers. Commonly taught in basic CNC courses: Techniques with sequence numbers 3N words are sequence numbers 3Not needed.
Know the Code… Students will participate in an activity that will help them understand CNC programming and how machines read programmed information.
CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Maximizing CNC Utilization Module three: Advanced implications of basic features Copyright
Manufacturing Automation
Industrial Engineering Department King Saud University
EPOCH 1000 Series Procedure Phase Array Straight Beam Calibration
Advanced Tool Management Information Module Advanced Tool Management Information Module.
Lesson One: Machine Configurations Turning Center Programming And Operation Copyright 2002, CNC Concepts, Inc.
Parametric Programming For CNC Machining Centers and Turning Centers Copyright 1999 Demo Only!! * Most items restricted * Poor sound quality (minimizes.
Lesson One: Machine Configurations
Machining Center Programming & Operation Copyright 2002, CNC Concepts, Inc.
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Record & run a macro Record & run a macro Save as a macro-
Programming Concepts Part B Ping Hsu. Functions A function is a way to organize the program so that: – frequently used sets of instructions or – a set.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
Modular Programming Chapter Value and Reference Parameters computeSumAve (x, y, sum, mean) ACTUALFORMAL xnum1(input) ynum2(input) sumsum(output)
Introduction to Robo Pro
Forging new generations of engineers
Intuitive Programming System For The Mill
Objective At the conclusion of this chapter you will be able to:
Fundamentals of C and C++ Programming. EEL 3801 – Lotzi Bölöni Sub-Topics  Basic Program Structure  Variables - Types and Declarations  Basic Program.
Motion Manipulation Words G32 – Thread cutting G15 & G16 – Polar coordinates G50 & G51 – Scaling G50.1 & G51.1 – Mirror image G60 – Single direction positioning.
1 Relates to machining and turning centers. 2 Commonly taught in basic CNC courses: 3Parameters are seldom mentioned 3Manipulated by maintenance people.
EPOCH 1000 Series Procedure Phased Array Angle Beam Calibration
(0,0) The Cartesian Coordinate System I IV III II +,- -,- +,+ -,+ Y+ Y- Z+ Z- X+ X- Basis for plotting all machine table positions The left/right axis.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Covenant College November 27, Laura Broussard, Ph.D. Professor COS 131: Computing for Engineers Chapter 5: Functions.
Delay Turning Center Programming, Setup, & Operation Copyright 2001, CNC Concepts, Inc.
Chapter 7 Data Sampling Screen Otasuke GP-EX! Chapter 7 Data Sampling Screen.
1 Introduction General information Comparison to subprogramming … to computer programming … to canned cycles Application categories Limitations Computer.
Introduction To CNC-Programming
JDS5 Training Guide. On Start Up you will see this screen click the OK button Click OK.
The Cartesian Coordinate System
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
CMSC 104, Version 8/061L09VariablesInC.ppt Variables in C Topics Naming Variables Declaring Variables Using Variables The Assignment Statement Reading.
BMFS 3373 CNC TECHNOLOGY Lecture 10
Automated Machining Adv. MMP
Data Structures & Algorithms CHAPTER 2 Arrays Ms. Manal Al-Asmari.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Mail Merge Introduction to Word Processing ITSW 1401 Instructor: Glenda H. Easter Introduction to Word Processing ITSW 1401 Instructor: Glenda H. Easter.
CNC Letters NOTE: The following will be a listing and description of Computer Numerical Control (CNC) Codes and Letter designations. We will try to stick.
CNC Codes and Letters NOTE: The following will be a listing and description of Computer Numerical Control (CNC) Codes and Letter designations. We will.
Introduction to the C Language
Special motion types Special interpolation types Helical motion
Topics Introduction to Repetition Structures
Part Programming Turning Applications.
Relates to machining and turning centers
Scripts & Functions Scripts and functions are contained in .m-files
JavaScript: Functions.
Vertical Milling.
5 Generating loops Introduction to looping
Statistical Analysis with Excel
CNC Programming for Mill
Variables and Arithmetic Operations
Statistical Analysis with Excel
ЧПУ Delta Electronics G-коды. Примеры
Machine components & motion directions (p. 15)
Computer Integrated Manufacturing
Unit 4 – Program Zero Discussion
CNC Milling/Lathe interface Introduction
System Programming by Leland L. Beck Chapter 2
Otasuke GP-EX! Chapter 5 Set Value Input Screen.
Overloading functions
Variables in C Topics Naming Variables Declaring Variables
Presentation transcript:

2 Variable Techniques Understanding variables Variables in custom macro B Presentation links page for lesson two Arguments Local variables Common variables Permanent common variables System variables

Introduction To Variables Jar AJar CJar B Jar C = Jar A + Jar B Jar A = 25Jar B = 31 Variables are like storage containers for numbers

Introduction To Variables G Provide storage for numbers G Have no meaning until used G Are used in arithmetic expressions G Can represent just about anything Of course, we’re not storing values in jars! Variables:

Introduction To Variables Tool 4 ? Offsets: A G43 H04 Z0.1 Offsets are a kind of variable… Tool length is unknown while programming During setup, length is measured Offset value is entered after measurement Command in program invokes offset value A Tool length A Cutter radius A Wear offset A Tool nose radius Offsets can only represent: Offsets usage is rather limited By comparison, variables can be used to represent just about anything!

Introduction To Variables Say you must mill a slot in several workpieces

Introduction To Variables But the width of each workpiece varies

Introduction To Variables But the width of each workpiece varies As does the position and depth With parametric programming, variables can be used to represent these workpiece attributes

Variable Types < Arguments < Local variables < Common variables < Permanent common variables < System variables There are five kinds of variables in custom macro B Let’s begin with arguments

Custom Macro B Arguments What is an argument? Definition: An argument is a piece of data needed by the custom macro program (input data) Arguments allow you to get data in to the custom macro

Custom Macro B Arguments G65 P1000A45. R2. H8. D.75 Call custom macro Input data (arguments) One form of argument in custom macro includes letters of the alphabet

For reasons we’ll describe later, avoid I, J, & K Custom Macro B Arguments ABCDEFH IJKMQRS TUVWXYZ Argument assignment number one: Not allowed: G, L, N, O, & P Allowable letters of the alphabet

Custom Macro B Arguments X Y Z D H An example: Choose logical representations: H for hole D for depth X for X position Y for Y position Z for Z position

Custom Macro B Arguments X Y Z D H An example: Choose logical representations: H for hole D for depth X for X position Y for Y position Z for Z position G65 P1000 X2.0 Y2.0 Z0 D0.25 H2.5 Call custom macro Arguments Argument assignment number one is, by far, the more popular form of argument assignment

Custom Macro B Arguments Argument assignment number two: A B CI J K This form of argument assignment is seldom used A, B, C, and ten sets of I, J, and K are allowed

Custom Macro B Arguments O1000 G00 XX ??? G65 P1000 X2.0 Y2.0 Z0 D0.25 H2.5 Arguments within a custom macro cannot be referenced by their letters The control would confuse many letters with their normal CNC functions Within the custom macro, arguments must be referenced with pre- determined local variables…

Variable Types < Arguments < Local variables < Common variables < Permanent common variables < System variables

Custom Macro B Local Variables # #1 : Variable number 1 #100 : Variable number 100 #500 : Variable number 500 In custom macros, all variables are specified with a pound sign

Custom Macro B Local Variables Represent arguments Reference temporary values The primary application for local variables is to reference the values of arguments coming from a G65 command Local variables are used to: Primary use

Custom Macro B Local Variables #1: #2: #3: #4: #5: #6: #7: #8: #9: #10: #11: #12: #13: #14: #15: #16: #17: #18: #19: #20: #21: #22: #23: #24: #25: #26: Local variables range through #33 The default state of local variables is vacant (having no value) Local variables are set back to vacant as the custom macro ends (with M99)

Custom Macro B Local Variables A:#1B:#2C:#3D:#7E:#8F:#9H:#11 I:#4J:#5K:#6M:#13Q:#17R:#18S:#19 T:#20U:#21V:#22W:#23X:#24Y:#25 Z:#26 Argument assignment number one: Each argument letter has a pre-assigned local variable! A chart for arguments and local variables is in the lesson text

Custom Macro B Local Variables G65 P1000 X2. Y2.5 Z0 D.25 H3. 1) Set values of local variables A G65 command does two things: Example of argument assignment… X:#24, Y:#25, Z:#26, D:#7, H:#11

Custom Macro B Local Variables #1: #2: #3: #4: #5: #6: #7: #8: #9: #10: #11: #12: #13: #14: #15: #16: #17: #18: #19: #20: #21: #22: #23: #24: #25: #26:

Custom Macro B Local Variables G65 P1000 X2. Y2.5 Z0 D.25 H3. 1) Set values of local variables 2) Execute program Example of argument assignment…

Custom Macro B Local Variables Nesting: Main: O0001. G65P1001 X2. Y2.5. M30 Level 1: O1001. G65P1002 X5. Y7.. M99 Level 2: O1002. M99. You can call one custom macro from another

#1: #2: #3: #4: #5: #6: #7: #8: #9: #10: #11: #12: #13: #14: #15: #16: #17: #18: #19: #20: #21: #22: #23: #24: #25: #26: Custom Macro B Local Variables Local variables #24 & #25 set from program O0001

Nesting: Main: O0001. G65P1001 X2. Y2.5. M30 Level 1: O1001. G65P1002 X5. Y7.. M99 Level 2: O1002. M99. Custom Macro B Local Variables

#1: #2: #3: #4: #5: #6: #7: #8: #9: #10: #11: #12: #13: #14: #15: #16: #17: #18: #19: #20: #21: #22: #23: #24: #25: #26: Custom Macro B Local Variables Local variables #24 & #25 set from program O1001

Nesting: Main: O0001. G65P1001 X2. Y2.5. M30 Level 1: O1001. G65P1002 X5. Y7.. M99 Level 2: O1002. M99. Custom Macro B Local Variables

#1: #2: #3: #4: #5: #6: #7: #8: #9: #10: #11: #12: #13: #14: #15: #16: #17: #18: #19: #20: #21: #22: #23: #24: #25: #26: Custom Macro B Local Variables Local variables #24 & #25 set from program O0001

Nesting: Main: O0001. G65P1001 X2. Y2.5. M30 Level 1: O1001. G65P1002 X5. Y7.. M99 Level 2: O1002. M99. Custom Macro B Local Variables

#1: #2: #3: #4: #5: #6: #7: #8: #9: #10: #11: #12: #13: #14: #15: #16: #17: #18: #19: #20: #21: #22: #23: #24: #25: #26: Custom Macro B Local Variables Local variables #24 & #25 set back to vacant

Nesting: Main: O0001. G65P1001 X2. Y2.5. M30 Level 1: O1001. G65P1002 X5. Y7.. M99 Level 2: O1002. M99. Custom Macro B Local Variables

Argument Assignment Example Mill left side of any workpiece Full example

Argument Assignment Example Mill left side of any workpiece Full example

Argument Assignment Example Mill left side of any workpiece Full example

Argument Assignment Example Z H Y T D O0001 N005 G54 G90 S300 M03 N010 G00 X0 Y0 N015 G43 H01 Z0.1 N020 G65 P1000 X0 Y0 Z0 H2. T1. D1.0 F4. N025 G91 G28 Z0 M19 N030 M01. X F - Feedrate Mill left side of any workpiece Full example

Argument Assignment Example Z H T O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 Y D #11 #26 #9 #25 #7 #20 F - Feedrate X #24 Mill left side of any workpiece Full example

Z H T O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 Y D #11 #26 #9 #25 #7 #20 #24 F - Feedrate X Argument Assignment Example Mill left side of any workpiece Full example

Argument Assignment Example Z H T O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 Y D #11 #26 #9 #25 #7 #20 #24 F - Feedrate X Mill left side of any workpiece Full example

Argument Assignment Example Z H T O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 X Y D #11 #26 #9 #25 #7 #20 #24 F - Feedrate Mill left side of any workpiece Full example

Argument Assignment Example Z H T O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 X Y D #11 #26 #9 #25 #7 #20 #24 F - Feedrate Mill left side of any workpiece Full example

Argument Assignment Example Z H T O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 Y D #11 #26 #9 #25 #7 #20 #24 F - Feedrate X Mill left side of any workpiece Full example

Argument Assignment Example Z H T O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 Y D #11 #26 #9 #25 #7 #20 #24 F - Feedrate X Mill left side of any workpiece Full example

Argument Assignment Example Z H T Y D O0001 N005 G54 G90 S300 M03 N010 G00 X0 Y0 N015 G43 H01 Z0.1 N020 G65 P1000 X0 Y0 Z0 H2. T1. D1.0 F4. N025 G91 G28 Z0 M19 N030 M01. #11 #26 #9 #25 #7 #20 #24 F - Feedrate X Mill left side of any workpiece Full example

Argument Assignment Example Z H T O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 Y D #11 #26 #9 #25 #7 #20 #24 F - Feedrate X Minimizing redundant calculations Full example

Argument Assignment Example Z H T O1000 #27 = #7/2 G00 X[#24- #27] Y[#25- #27 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #27] F#9 G00 Z[# ] M99 Y D #11 #26 #9 #25 #7 #20 #24 F - Feedrate X Minimizing redundant calculations If you wish to use local variables for temporary calculations, use those from #26-#33 to keep from overwriting a needed variable! Full example

Argument Assignment Example Tapping on a turning center Another example

Argument Assignment Example Tapping on a turning center Another example

Argument Assignment Example Tapping on a turning center Another example

Argument Assignment Example F Z R O0001 N005 G00 T0101 N010 G97 S500 M03 N015 G65 P1001 R.2 Z-1. F.0625 N020 G00 X6.0 X5.0 N025 M01. Tapping on a turning center Another example

Argument Assignment Example F Z R #9 #26 #18 O1001 G00 X0 Z#18 G32 Z#26 F#9 M04 G32 Z#18 F#9 M03 M99 Tapping on a turning center Another example

Argument Assignment Example F Z R #9 #26 #18 O1001 G00 X0 Z#18 G32 Z#26 F#9 M04 G32 Z#18 F#9 M03 M99 Tapping on a turning center Another example

Argument Assignment Example F Z R #9 #26 #18 O1001 G00 X0 Z#18 G32 Z#26 F#9 M04 G32 Z#18 F#9 M03 M99 Tapping on a turning center Another example

Argument Assignment Example F Z R #9 #26 #18 O1001 G00 X0 Z#18 G32 Z#26 F#9 M04 G32 Z#18 F#9 M03 M99 Tapping on a turning center Another example

Argument Assignment Example F Z R #9 #26 #18 O1001 G00 X0 Z#18 G32 Z#26 F#9 M04 G32 Z#18 F#9 M03 M99 Tapping on a turning center Another example

Argument Assignment Example F Z R #9 #26 #18 O1001 G00 X0 Z#18 G32 Z#26 F#9 M04 G32 Z#18 F#9 M03 M99 Tapping on a turning center Another example

Argument Assignment Example F Z R #9 #26 #18 O1001 G00 X0 Z#18 G32 Z#26 F#9 M04 G32 Z#18 F#9 M03 M99 Tapping on a turning center Another example

Argument Assignment Example F Z R O0001 N005 G00 T0101 N010 G97 S500 M03 N015 G65 P1001 R.2 Z-1. F.0625 N020 G00 X6.0 X5.0 N025 M01. Tapping on a turning center Another example

Argument Assignment Example F Z R O0001 N005 G00 T0101 N010 G97 S500 M03 N015 G65 P1001 R.2 Z-1. F.0625 N020 G00 X6.0 X5.0 N025 M01. Tapping on a turning center Another example

Argument Assignment Example Z R O0001 N005 G00 T0101 N010 G97 S500 M03 N015 G65 P1001 R.2 Z-1. F16. N020 G00 X6.0 X5.0 N025 M01. F: TPI Tapping on a turning center Could be number of threads per inch Another example

Argument Assignment Example Z R O0001 N005 G00 T0101 N010 G97 S500 M03 N015 G65 P1001 R.2 Z-1. F16. N020 G00 X6.0 X5.0 N025 M01. O1001 G00 X0 Z#18 G32 Z#26 F[1/ #9] M04 G32 Z#18 F[1/ #9] M03 M99 F: TPI Tapping on a turning center Another example

Local Variables #1 #2 #3 #4 #5 #6 #7 #8 #9 #10 #11 #12 #13 #14 #15 #16 #17 #18 #19 #20 #21 #22 #23 #24 #25 #26 #27 #28 #29 #30 #31 #32 #33 With argument assignment number one: Available for use for calculations: Again, if you wish to use local variables for temporary calculations, use these to keep from overwriting a needed variable! Use these local variables for general purpose calculations

Variable Types < Arguments < Local variables < Common variables < Permanent common variables < System variables

Common Variables # #100 - #149 Until power off Retained until M30 or Common variables are less volatile than local variables! Common variables range from #100 through #149 A parameter setting controls when common variables are set back to vacant

Common Variables You can actually see variable values Press SET or SETTING several times Press OFFSET and then MACRO or …depending upon control model

Common Variables G00 X[# * #7] #100 = # * #7. G00 X#100 An application: Calculating values up front: Calculation done in motion command Calculation done up-front

Common Variables G00 X[# * #7] #100 = # * #7. G00 X#100 A note about brackets ([ ])… Brackets required when a calculation is done within a CNC word Brackets not required

If you’re using custom macro to create a canned cycle application, use G65 to pass arguments Z U Y X D F: Feedrate O0003 N005 G54 G90 S500 M03 N010 G00 X0 Y0 N015 G43 H01 Z0.1 N020 G65 P1003 X1. Y1. U4. Z0 D.25 F5. N025 G65 P1003 X1. Y3. U4. Z0 D.25 F5. N030 G91 G28 Z0 M19 N035 M01. Common Variables Program startup format Call user-created canned cycle

.5 Common Variables But in part family applications:

Common Variables #101 #102 #103 #104 O0006 (Cap blocks) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS). N25 G81 R.1 Z-[# ] F5.. Use common variables Place them at beginning Note messages Reference them as needed Use common variables to specify input data (arguments) at the very beginning of the part family program! Be sure to label each with a documenting message!

Common Variables O1001. #104 = 400. M99 O0001. G65 P G65 P M30 O1002. S#104 M03. M99 Common variables are retained until the power is turned off You can use common variables from one program to another! Invoke custom macro Common variable set in one program… …can be referenced in another

Common Variable Example Z H T O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 Y D #11 #26 #9 #25 #7 #20 F - Feedrate X #24 Calculating values up front: Example shown earlier

Common Variable Example O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 Calculating values up front:

O1000 G00 X[#24-#7/2] Y[#25-#7/2 -.1] Z[#26 - # ] G01 Y[#25 + #11 + #7/2] F#9 G00 Z[# ] M99 O1000 #100 = #24 - #7/2 #101 = #25 - #7/2 -.1 #102 = #26 - # #103 = #25 + #11 + #7/2 #104 = # G00 X#100 Y#101 Z#102 G01 Y#103 F#9 G00 Z#104 M99 Calculating values up front: Common Variable Example You can use common variables to calculate values that will be needed later in the program!

Common Variable Example O1000 / #100 = #24 - #7/2 / #101 = #25 - #7/2 -.1 / #102 = #26 - # / #103 = #25 + #11 + #7/2 / #104 = # G00 X#100 Y#101 Z#102 G01 Y#103 F#9 G00 Z#104 M99 Calculating values up front: With block delete, you can save calculation time once variables have been calculated once!

Common Variable Example Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 (1/2 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 O0006 (Cap plate) #101 = 5. (X LENGTH) #102 = 3. (Y LENGTH) #103 =.25 (SLOT DEPTH) #104 = 1. (THICKNESS) N05 T01 M06 Drill) N10 G54 G90 S500 M03 N15 G00 X.5 Y.5 N20 G43 H01 Z.1 N25 G81 R.1 Z-[# ] F5. N30 Y[#102-.5] N35 X[#101-.5] N40 Y.5 N45 G80 N50 G91 G28 Z0 M19 N55 M01 Part family example:

Common Variable Example #101 #102 #103 #104 N55 M01 N60 T02 M06 (3/4 Mill) N65 G54 G90 S300 M03 N70 G00 X[#101/2] Y-.475 N75 G43 H02 Z-#103 N80 G01 Y[# ] N85 G00 Z0.1 N90 G91 G28 Z0 M19 N95 M30 Part family example:

Common Variable Example #101 #102 #103 #104 N55 M01 N60 T02 M06 (3/4 Mill) N65 G54 G90 S300 M03 N70 G00 X[#101/2] Y-.475 N75 G43 H02 Z-#103 N80 G01 Y[# ] N85 G00 Z0.1 N90 G91 G28 Z0 M19 N95 M30 Part family example:

Common Variable Example #101 #102 #103 #104 N55 M01 N60 T02 M06 (3/4 Mill) N65 G54 G90 S300 M03 N70 G00 X[#101/2] Y-.475 N75 G43 H02 Z-#103 N80 G01 Y[# ] N85 G00 Z0.1 N90 G91 G28 Z0 M19 N95 M30 Part family example:

#101 #102 #103 #104 N55 M01 N60 T02 M06 (3/4 Mill) N65 G54 G90 S300 M03 N70 G00 X[#101/2] Y-.475 N75 G43 H02 Z-#103 N80 G01 Y[# ] N85 G00 Z0.1 N90 G91 G28 Z0 M19 N95 M30 Part family example: Common Variable Example

#101 #102 #103 #104 N55 M01 N60 T02 M06 (3/4 Mill) N65 G54 G90 S300 M03 N70 G00 X[#101/2] Y-.475 N75 G43 H02 Z-#103 N80 G01 Y[# ] N85 G00 Z0.1 N90 G91 G28 Z0 M19 N95 M30 Part family example: Common Variable Example

#101 #102 #103 #104 N55 M01 N60 T02 M06 (3/4 Mill) N65 G54 G90 S300 M03 N70 G00 X[#101/2] Y-.475 N75 G43 H02 Z-#103 N80 G01 Y[# ] N85 G00 Z0.1 N90 G91 G28 Z0 M19 N95 M30 Part family example: Common Variable Example

#101 #102 #103 #104 N55 M01 N60 T02 M06 (3/4 Mill) N65 G54 G90 S300 M03 N70 G00 X[#101/2] Y-.475 N75 G43 H02 Z-#103 N80 G01 Y[# ] N85 G00 Z0.1 N90 G91 G28 Z0 M19 N95 M30 Part family example: Common Variable Example

#101 #102 #103 #104 N55 M01 N60 T02 M06 (3/4 Mill) N65 G54 G90 S300 M03 N70 G00 X[#101/2] Y-.475 N75 G43 H02 Z-#103 N80 G01 Y[# ] N85 G00 Z0.1 N90 G91 G28 Z0 M19 N95 M30 Part family example: Common Variable Example

#101 #102 #103 #104 N55 M01 N60 T02 M06 (3/4 Mill) N65 G54 G90 S300 M03 N70 G00 X[#101/2] Y-.475 N75 G43 H02 Z-#103 N80 G01 Y[# ] N85 G00 Z0.1 N90 G91 G28 Z0 M19 N95 M30 Common Variable Example Part family example:

Variable Types < Arguments < Local variables < Common variables < Permanent common variables < System variables

Permanent Common Variables #500 - #509 Retained even after power off # Some controls have more than ten Use permanent common variables for applications that require that you retain data even after the power is turned off!

Permanent Common Variables l Part counters l Tool life management l Cycle time meter

Permanent Common Variables O0001 N005 T0101 M41 N010 G97 S500 M03 N015G00 X0.5 Z0.1 N020 G01 Z-1.0 F0.005 N025 G00 Z0.1 N030 G00 X6.0 Z5.0 N035 M01. Make your approach value a system constant Examples…

Permanent Common Variables O0001 N005 T0101 M41 N010 G97 S500 M03 N015G00 X0.5 Z#500 N020 G01 Z-1.0 F0.005 N025 G00 Z#500 N030 G00 X6.0 Z5.0 N035 M01. Make your approach value a system constant Examples…

O0001 N005 T0101 M41 N010 G97 S500 M03 N015G00 X0.5 Z#500 N020 G01 Z-1.0 F0.005 N025 G00 Z#500 N030 G00 X6.0 Z5.0 N035 M01. Permanent Common Variables Eliminate M code inconsistencies from machine to machine Examples…

Permanent Common Variables O0001 N005 T0101 M#501 N010 G97 S500 M03 N015G00 X0.5 Z#500 N020 G01 Z-1.0 F0.005 N025 G00 Z#500 N030 G00 X6.0 Z5.0 N035 M01. Eliminate M code inconsistencies from machine to machine Examples…

Permanent Common Variables # __________ # __________ # __________ # __________ # __________ # __________ # __________ # __________ # __________ O0001 SETVN 500 [APPROACH] SETVN 501 [LOW RANG] #500= 0.1 #501 = 41 M30 You can even label permanent common variables SETVN stands for Set Variable Name

Permanent Common Variables # APPROACH # LOW RANG # __________ # __________ # __________ # __________ # __________ # __________ # __________ O0001 SETVN 500 [APPROACH] SETVN 501 [LOW RANG] #500= 0.1 #501 = 41 M30 You can even label permanent common variables

Permanent Common Variables # APPROACH # LOW RANG # __________ # __________ # __________ # __________ # __________ # __________ # __________ 0.1 You can also enter values manually

Permanent Common Variables # APPROACH # LOW RANG # __________ # __________ # __________ # __________ # __________ # __________ # __________ You can also enter values manually

Permanent Common Variables # RADIUS # X+ O&D # X- O&D # Y+ O&D # Y- O&D # LENGTH # __________ # __________ # __________ Be careful! Some may be used by other devices! These are probe calibration values!

Permanent Common Variables O0008 (Main program). N445 G65 P1008 C250. N450 M30 O1008 #500 = # IF[#500 LT #3] GOTO 99 #500 = 0 #3000 = 100 (PART COUNT ACHIEVED) N99 M99 A part counter We’ll explain the IF statement in detail later

Variable Types < Arguments < Local variables < Common variables < Permanent common variables < System variables

System Variables # >#1000 Access to many CNC features

System Variables X #1000 series: Input/output signals X Interface with accessories X #2000 series: Tool offsets X Read and write X #3000 series: Misc. CNC features X Alarm, control panel functions, stop w/message X #4000 series: Modal states X G code groups, current word address status X #5000 series: Axis position X Relative to program zero or zero return More on system variables later