91ÊÓÆµÍøÕ¾ÎÛ

Published

Understanding Argument Assignment Number Two

With custom macro B there are two different forms of argument assignment for the G65 command to call a custom macro. By far, the more popular is argument assignment number one.

Share

Leaders-In background

With custom macro B there are two different forms of argument assignment for the G65 command to call a custom macro. By far, the more popular is argument assignment number one. Here are most of the local variable representations in with argument assignment number one:

A: #1, B: #2, C: #3, D: #7, E: #8, F: #9, H: #11, I: #4, J: #5, K: #6, M: #13, Q: #17, R: #18, S: #19, T: #20, U: #21, V: #22, W: #23, X: #24, Y: #25, Z: #26

While the local variable number selection may not make complete sense, these local variables are used in the custom macro to represent their corresponding letter addresses when argument assignment number one is used.

Now, here are the local variable representations when argument assignment number two is used:

A: #1, B: #2, C: #3, I: #4, J: #5, K: #6, I: #7, J: #8, K: #9, I: #10, J: #11, K: #12, I: #13, J: #14, K: #15, I: #16, J: #17, K: #18, I: #19, J: #20, K: #21, I: #22, J: #23, K: #23, I: #25, J: #26, K: #27, I: #28, J: #29, K: #30, I: #31, J: #32, K: #33

Notice that the letter addresses A, B, and C are followed by ten sets of I, J, and K. A, B, and C work just as they do in argument assignment number one, but I, J, and K are a little different. Think of the first set of I, J, and K as I(1), J(1), and K(1). Think of the second set as I(2), J(2), and K(2) – and so on through I(10), J(10), and K(10). Again, you’ll have up to ten sets of I, J, and K with which to work.

The first I in the G65 command will be represented by local variable #4; the first J by #5; the first K by #6. The second I in the G65 command will be represented by #7; the second J by #8, and the second K by #9. The tenth I in the G65 command (if there are ten) will be represented by #31, the tenth J by #32, and the tenth K by #33. Here’s an example call statement using argument assignment number two:

N010 G65 P1002 A1.75 B-0.6 C1.0 I12.0 J1.75 I35.0 J1.625 I175.0 J1.1 I25.0 J1.75 I113.0 J1.75

K is not being used in this example. Here is how the local variables will be assigned:

#1: 1.75, #2: -0.6, #3: 1.0, #4: 12.0 #5: 1.75, #7: 35.0, #8: 1.625, #10: 175.0, #11: 1.1, #13: 25.0, #14: 1.75, #16: 113.0, #17: 1.75

You may be wondering why argument assignment number two is so important. This method of argument assignment is helpful—and possibly the only way to handle the application—when you want to pass groups of information to the custom macro. Up to ten groups (ten sets of I, J, and K) containing three pieces of information each (again, I, J, and K values).

One potential application might be a tool life management system. Up to ten groups of tools could be specified in the G65 command, containing three pieces of information per group (possibly tool type, tool life in number of parts, and how many replacement tools are in the group).

The drawing below is for a circular cam—it’s actually the previously shown example.

As you can see, we’re using I and J (K is not needed) to specify the rises and falls around the cam. I specifies the angular length of the current rise or fall and K specifies its ending radius. Letter address A specifies the starting radius, B the depth to mill, and C the incremental angle for calculations (C1.0 will cause each movement around the cam to be 1.0 degree).
Here is the calling (main) program:

O2001 (Main program for cam)
N005 G54 (Set program zero)
N010 G65 P1002 A1.75 B-0.6 C1.0 I12.0 J1.75 I35.0 J1.625 I175.0 J1.1 I25.0 J1.75 I113.0 J1.75 (Mill entire cam)
N015 M30 (End of program)

Again, this kind of argument assignment makes it very easy to specify groups of data to your custom macro. With our cam example, a cam with up to ten rises and falls can be easily defined and machined.

There is not enough room to provide the entire cam custom macro program here. If you would like to see full program, visit http://www.cncci.com/resources/tips/arg2.htm.

Related Content

Automotive

4 Tips for Staying Profitable in the Face of Change

After more than 40 years in business, this shop has learned how to adapt to stay profitable.

Read More
Basics

Custom Workholding Principles to Live By

Workholding solutions can take on infinite forms and all would be correct to some degree. Follow these tips to help optimize custom workholding solutions.

Read More
Turn/Mill

How to Meet Aerospace’s Material Challenges and More at IMTS

Succeeding in aerospace manufacturing requires high-performing processes paired with high-performance machine tools. IMTS can help you find both.

Read More
Basics

4 Manufacturing Trends That Cannot Be Ignored

The next five years will present their own unique set of challenges, and shops can alleviate them by embracing these technologies and trends.

Read More

Read Next

Automation

AMRs Are Moving Into Manufacturing: 4 Considerations for Implementation

AMRs can provide a flexible, easy-to-use automation platform so long as manufacturers choose a suitable task and prepare their facilities.

Read More
Top Shops

Last Chance! 2025 Top Shops Benchmarking Survey Still Open Through April 30

Don’t miss out! 91ÊÓÆµÍøÕ¾ÎÛ's Top Shops Benchmarking Survey is still open — but not for long. This is your last chance to a receive free, customized benchmarking report that includes actionable feedback across several shopfloor and business metrics. 

Read More
Basics

Machine Shop MBA

  Making Chips and 91ÊÓÆµÍøÕ¾ÎÛ are teaming up for a new podcast series called Machine Shop MBA—designed to help manufacturers measure their success against the industry’s best. Through the lens of the Top Shops benchmarking program, the series explores the KPIs that set high-performing shops apart, from machine utilization and first-pass yield to employee engagement and revenue per employee.  

Read More