top of page

Activating a custom macro from a T word

This is necessary if you want to incorporate the techniques shown in the Macro Maven article of this newsletter.


With custom macro B, you have the ability to activate custom macros in several ways. A G65 command, for example, is one way. When the control executes the command:

  • N040 G65 P9000 A0.5, B3.0

it will first set the values for local variables (#1 and #2 in this case) and then execute program number O9000 (specified by the P word).


Again, this is a handy way to call a custom macro from a program, but it is not the only way. By changing certain control parameters, you can actually have a custom macro executed by a G or M code of your choosing, an S word, or a T word. We’re, of course, interested in the T word.


You must understand that there is one (and one only) program number that is used when T words are used to activate custom macros. It happens to be program number O9000. Once the parameter is changed two things will happen whenever a T word is executed. First the control will store the value of the T word (the station number for most machines) into common variable #149. Second, the control will execute program O9000.


As with all parameters, the parameter number for the T word controlling parameter varies from one Fanuc control model to another. You must reference your Fanuc Operator’s Manual in order to find the related parameter. It will be documented in the custom macro section of the book. For a 16 series control (16T or 16M), it happens to be bit 5 (sixth bit from the right) of parameter number 6001 and is labeled as TCS (for T code with custom macro, presumably). It’s normal setting is zero. If you change this bit to a one (1), the control will execute program O9000 whenever a T word is executed.


Note that, from this point, the T word by itself is no longer going to command a turret rotation or tool change. Somewhere in program O9000, another T word must be specified for this purpose. In our offset setting custom macro, it is close to the end of the custom macro.

389 views1 comment

Recent Posts

See All

Tapping on a turning center (without canned cycles)

Unless your Fanuc controlled turning center came with live tooling, it’s likely that you don’t have canned cycles (G80-G89) like those you find on machining centers. You might have G74 and G75, the mu

Can you speed up your tool change time?

Machining centers, of course, have automatic tool changing devices to automate the tool changing process. Current models boast very fast tool changing times and you may be quite satisfied with tool ch

bottom of page