OASIS Inspection Systems
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

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.

CHIRON Group, one stop solution for manufacturing.
DN Solutions
Paperless Parts
SolidCAM
Koma Precision
To any Measurement Question there is an Answer
OASIS Inspection Systems
Hurco
Kennametal
Hurco
SolidCAM
Gravotech

Related Content

Milling Tools

10 Tips for Titanium

Simple process considerations can increase your productivity in milling titanium alloys.

Read More

6 Steps to Take Before Creating a CNC Program

Any time saved by skipping preparation for programming can be easily lost when the program makes it to the machine. Follow these steps to ensure success.

Read More
Turn/Mill

Understanding Swiss-Type Machining

Once seen as a specialty machine tool, the CNC Swiss-type is increasingly being used in shops that are full of more conventional CNC machines. For the newcomer to Swiss-type machining, here is what the learning curve is like.

Read More
SPONSORED

How to Reduce Cycle Times by 70% and More on Your Existing CNCs and Dramatically Improve Tool Life Too

By employing advanced high efficiency milling techniques for the entire machining routine, SolidCAM’s iMachining technology can drastically reduce cycle times while vastly improving tool life compared to traditional milling.

Read More

Read Next

Vertical Machining Centers

The Cut Scene: The Finer Details of Large-Format Machining

Small details and features can have an outsized impact on large parts, such as Barbco’s collapsible utility drill head.

Read More

3 Mistakes That Cause CNC Programs to Fail

Despite enhancements to manufacturing technology, there are still issues today that can cause programs to fail. These failures can cause lost time, scrapped parts, damaged machines and even injured operators.

Read More
To any Measurement Question there is an Answer