Skip to main content

Connecting a Fanuc Machine over RS-232 (DPRNT)

Older Fanuc controls often have no Ethernet port, or no FOCAS option, so they can't use the network connection. They almost always have an RS-232 serial port, though. Over that port, the NC program can report what it's doing with DPRNT (Fanuc's "print to serial port" macro command): which program started, when a part was made, and when the program ended. Your T-Connect device listens on the serial port and turns those lines into program names and part counts in TrackMyMachines.

info

This uses the same T-Connect device from your installation, plus a USB-to-RS-232 adapter plugged into the T-Connect's USB port. We recommend an FTDI-based adapter. The T-Connect only listens: it never sends anything to the control.

There are three parts to this:

  1. The Fanuc control: set up its serial port.
  2. TrackMyMachines: set the T-Connect to listen with the same settings.
  3. The NC program: add the DPRNT lines that report the program and parts.

Before you start​

  • Your T-Connect device is already installed and online — see If your T-Connect isn't connecting if it isn't.
  • The control has the Custom Macro (Macro B) option. DPRNT needs it.
  • You have a crossover (Null Modem) serial cable from the control's RS-232 port (usually a 25-pin DB25) to the adapter (usually a 9-pin DB9). If the cable already works with a PC for sending programs, it will work here.
  • You (or your maintenance engineer) can change the control's SETTING and PARAMETER screens. Parameters need parameter-write enabled and the memory-protect key unlocked.

Step 1: Check the control's serial settings​

  1. On the SETTING screen, note the I/O CHANNEL (parameter 0020). It's usually 0. DPRNT goes out on this channel.
  2. Check the code is ISO on the same screen. Depending on the control, it's called PUNCH CODE or ISO CODE, and it should be 1. The T-Connect reads ISO, not EIA. This is also where you set PARAMETER WRITE to 1 before you change any parameters. Set it back to 0 when you're done.
Fanuc 16i SETTING (HANDY) screen showing PARAMETER WRITE = 0, PUNCH CODE = 1 (ISO) and I/O CHANNEL = 0
The SETTING screen on a Fanuc 16i: PUNCH CODE = 1 (ISO) and I/O CHANNEL = 0. PARAMETER WRITE is 0 here, so parameters can't be changed until it's set to 1.

The same setting is the ISO bit of parameter 0000:

Fanuc 16i PARAMETER (SETTING) screen showing parameter 0000 with the ISO bit set to 1
Parameter 0000 on the PARAMETER (SETTING) screen, with the ISO bit set to 1.
  1. Open PARAMETER and find the RS-232C settings for that channel. For channel 0 they are 0101–0103 (channel 1: 0111–0113, channel 2: 0121–0123):

    ParameterWhat it isRecommended
    0101 bit 0 (SB2)Stop bits1 = 2 stop bits
    0101 bit 7 (NFD)Feed (NUL) characters1 = none
    0102Device type0 (generic RS-232)
    0103Baud rate11 = 9600

    If the machine already uses its serial port for sending programs, leave these as they are and copy them into TrackMyMachines in Step 2 instead.

Fanuc 16i PARAMETER (RS232C INTERFACE) screen showing 0100, 0101 with SB2 set, 0102 DEVICE NUM 0 and 0103 BAUDRATE 11
The RS232C INTERFACE parameters on a Fanuc 16i: 0101 with SB2 = 1 (2 stop bits), 0102 = 0, 0103 = 11 (9600 baud).
info

Exact screen names vary between control generations (0, 16i/18i, 0i, 30i), but the parameter numbers are the same.

Step 2: Configure the machine in TrackMyMachines​

  1. Go to Manage → Machines and open the machine (or create it first — see Adding a machine).

  2. Under Advanced Settings, open Machine connection and set Direct machine connection type to DPRNT over RS-232.

  3. Open USB configuration and match the control:

    FieldValue
    USB baud ratethe control's baud rate (9600 for 0103 = 11)
    USB data bits7 bits
    USB stop bits2 stopbits (or 1 stopbit if SB2 is 0)
    USB parityEven
    Enable RTS/CTS flow controlticked
    Enable DTR/DSR flow controlticked
  4. Click Update Machine.

The change is pushed out to your T-Connect device automatically. Restart the T-Connect (or unplug and replug the USB adapter) so it opens the serial port with the new settings.

:::warning Tick both flow control boxes A Fanuc control checks two handshake lines before it sends anything, and the T-Connect only raises them when these boxes are ticked:

  • Without DTR/DSR, the control stops at the first DPRNT with alarm 086 DR SIGNAL OFF.
  • Without RTS/CTS, there's no alarm, but the control waits forever at the first DPRNT and the program never continues.

A PC raises both lines whenever a program opens its serial port, which is why the same cable works from a PC without these settings. :::

Step 3: Add the DPRNT lines to the NC program​

The program has to print status lines for the T-Connect to read. Use these three trigger words. They're the same ones CIMCO MDC-Max uses, so existing CIMCO post processors work as they are:

WhereLineMeaning
Start of programMAXCYCLESTART*<name>Program <name> is running
Each part, before M30MAXPARTCOMPLETE*PC<n>A part was made; <n> is the machine's counter
End, before M30MAXCYCLESTOPProgram finished

For example:

O1234 (BRACKET-OP10)
POPEN
DPRNT[MAXCYCLESTART*BRACKET-OP10]
PCLOS
... (the program)
#1=#3901+1 (count this part)
POPEN
DPRNT[MAXPARTCOMPLETE*PC#1[60]]
G04 P1000
DPRNT[MAXCYCLESTOP]
PCLOS
M30
  • * prints as a space. DPRNT can't print a real space.
  • Program name: optional, and written into the line as plain text (Fanuc can't print a text variable). To print the O-number instead, use DPRNT[MAXCYCLESTART*O#4115[40]]. With no name, TrackMyMachines shows DPRNT.
  • Part count: #3901 is the control's part counter, but it only goes up at M30, after the DPRNT. So the example adds one first. It uses #1, a local variable, so it can't clash with any common variable (#100 upward) your shop's own macros might use. [60] means print 6 digits and no decimals. If you'd rather let the T-Connect count, print just DPRNT[MAXPARTCOMPLETE] and it adds one each time.
  • Programs longer than 30 minutes: repeat the MAXCYCLESTART line (same name) at tool changes. If the T-Connect hears nothing for 30 minutes, it stops showing the program as running.
  • Characters: stick to uppercase letters, digits and -. Keep each line under 127 characters and the name under 64.

Step 4: Test it​

  1. Run a short program in MDI or from memory with just the DPRNT lines, for example:

    POPEN
    DPRNT[MAXCYCLESTART*TEST]
    G04 P20000
    DPRNT[MAXPARTCOMPLETE]
    G04 P20000
    DPRNT[MAXCYCLESTOP]
    PCLOS
    M30
  2. In TrackMyMachines, the machine should show program TEST running, then its part count go up by one, then the program stop.

Things to know​

  • Only one thing can use the serial port at a time. While t-DNC or a PC is sending a program over the same port, the T-Connect hears no DPRNT lines.
  • If the T-Connect is unplugged or off, the control can't send and stops at POPEN (alarm or wait, as above). If that's a problem on your shop floor, wrap the DPRNT lines in an IF on a variable the operator can set to turn them off.
  • Aborted programs (reset, E-stop) keep showing as running until the next MAXCYCLESTART or the 30-minute timeout. Feed hold and alarms aren't visible over DPRNT.

Need help?​

If nothing shows up in TrackMyMachines:

  • Alarm 086 DR SIGNAL OFF, or the control hangs at the first DPRNT: tick both flow control boxes, then restart the T-Connect.
  • The program runs but nothing appears: check the baud rate, data bits, stop bits and parity match the control exactly, and that PUNCH CODE (or ISO CODE) is 1.

Still stuck? Email support@trackmymachines.com.