Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Equipment >> Industrial equipment

Efficiently Invoking Custom Macros via G65 Modal Commands

Efficiently Invoking Custom Macros via G65 Modal Commands

If you have programmed with Custom Macro, you probably know that one way to call a Custom Macro program is to use a G65 command. Users typically input this command in a main program, specifying the program number for the Custom Macro (with a P-word) and a series of letter address arguments (variables) to pass to the Custom Macro.

Consider the following command for calling a round pocket-machining Custom Macro:

X and Y specify the pocket center location. Z indicates the surface where the machine will make the pocket. D is the depth and R is the pocket radius. F specifies the machining feed rate.

G65 is not modal. To machine another round pocket in a different location, the user must provide another complete G65 command (changing the related arguments, of course). FANUC CNCs have, however, two G-codes for modally calling a Custom Macro: G66 and G66.1. After instating either of them, the programmer must use G67 to cancel them.

G66

G66 does not call the Custom Macro by itself; it will only assign the local variables that correspond to the specified letter address arguments. Consider these commands:

Line N050 sets local variable #26 to the value of Z, #7 to the value of D, #18 to R, #20 to T and #9 to F. But, again, this line does not call Custom Macro O1000.

In the next command (N055), which must be a motion command (usually G00 or G01), the CNC will move to the commanded position and then call Custom Macro O1000. Local variables assigned in the G66 command will be available for use in the Custom Macro, but there is no way to update them after executing the G66 command. The CNC will continue to move into position and call the Custom Macro in subsequent motion commands until it reaches the G67 (N075) command.

Here is an example of the round pocket Custom Macro when using G66:

G66.1

Like G66, a G66.1 command will specify the Custom Macro number and set local variables to the value of letter address arguments. Also like G66, a G67 command must eventually be specified to cancel the modal calling. But unlike G66, G66.1 will call the Custom Macro. Consider these commands:

Now, line N050 will machine the first pocket. In each subsequent command which is not a motion command, the CNC will reset the local variables and call the Custom Macro again. In line N055, the value of local variable #24 (X) becomes 10.0. Assuming the programmer wrote the Custom Macro correctly, a motion command in the Custom Macro will move the tool to this position before the machine begins creating the pocket.

The advantage of G66.1 over G66 is that any of the letter address arguments can change during any of the times the user calls the Custom Macro. If the depth of the pocket changes for the pocket N060 machines, for instance, the programmer can include the letter address D in line N060.

Creating Custom Macros using G66.1 is more involved than G66. Since the values of all the local variables return to vacant at the M99 command that ends the Custom Macro, users must store these values in common variables that are not lost until the power is turned off.

Consider this Custom Macro program using G66.1:

Which Custom Macro Command Is Better? G66 or G66.1?

While it requires more programming work, G66.1 provides more flexibility than G66. Namely, the programmer can change any argument in any of the commands between the G66.1 and the G67 command. In our example, this means the pocket’s X/Y position, radius, depth, Z-surface location or feed rate. In this sense, a Custom Macro called with G66.1 behaves almost exactly like any hole-machining canned cycle, like G81.

On the other hand, if you are sure there will be no need to change things after specifying the initial set of arguments, using G66 may be more suited to your application, since G66 is so much easier to use.


Industrial equipment

  1. Weld-On vs Through-Pull Handles: Which Is Best for Your Applications?
  2. Precision Custom Coatings Embarks on Lean Transformation to Enhance Product Quality and Customer Service
  3. Essential MATLAB Commands for Efficient Computing
  4. New Alpha X Series Lathes Feature Custom Controls for Superior Performance
  5. When to Use Custom Macros in CAM Systems for Optimal Safety and Quality
  6. How Custom Macros Simplify Tool Replacement and Resume Operations Seamlessly
  7. Top 5 Benefits of Custom Metal Fabrication
  8. Unlock Precision & Profit with Custom Machining Solutions
  9. Wireless Robot Control via Bluetooth: Thesis and DIY Project Overview
  10. Create a Custom G81 Drilling Cycle Using Fanuc Macro and G66 Modal Call