I am trying to interface an RS232 controlled device to a CNC mill with a Fanuc 21i control. The object is to send the tool number out the RS232 port via DPRNT command. This method has worked in the past very well in machines with a tool changer macro- just add the DPRNT sequence to the end of the macro.
Unfortunately, this machine (and others) doesn't have an ATC macro.
My current approach is to create a macro to "hijack" the M06 and add the DPRNT on after- like this:
Param 6080=6 (point M06 at macro O9020)
Param 6001 #1 =0 (force leading zeros)
O9020;
M06;
POPEN;
DPRNT[T#4120[20]];
PCLOS;
M99;
This works, but ONLY if the T-code is in a block by itself, followed by the M06 in a separtate block:
T15;
M06;
etc;
If the M06 follows the T in the same block
T15 M06;
the control displays an error (something about a T-command- didn't write it down) and stops running.
I would like to find a way to execute this DPRNT with any M06 presented in any format the control will accept it; ie, transparent to the user or programmer.
Any thoughts?
Marc