bg

Machine data with Fanuc DPRNT: log cycles, tool changes and probe results

Your CNC already knows when a cycle starts and ends, which tool is in the spindle and what the probe measured. With Fanuc's DPRNT command it can tell a PC over the same RS-232 port that loads its programs. DNC Precision Enterprise listens on that port, recognises the messages and logs them with the date and time, ready for Excel, CSV or a SQL database.

What you can record

  • Cycle start and stop, for cycle times, load times and the number of cycles per shift.
  • Tool changes, with the tool number.
  • Part counts and program numbers.
  • Probe and measurement results: any macro variable, for example the deviations an in-process probe reports.
  • Your own messages, such as the operator's name or a reason for a stop.

How it works

  1. The NC program, or a macro it calls, opens the port with POPEN, prints a short message with DPRNT and closes the port with PCLOS.
  2. The message travels over the RS-232 cable to the PC.
  3. DNC Precision recognises messages in a format you choose (by default they look like (***CYCLESTART***) or (***A=1234***)), gives each trigger name a meaning and writes a line with the date and time.
  4. Export plugins write the records to Excel, CSV files or SQL databases, with the columns you assign.

Check the option first

DPRNT is part of Fanuc Custom Macro B. In EDIT mode, type POPEN and press INSERT. If the control shows the word as you typed it, the option is there. If it puts spaces between the letters (P O P E N), it is not, and you can still record cycle start and stop with the relay method below.

The control must also send its output to the RS-232 port: check the I/O channel or output setting in the control's manual. Haas controls support DPRNT as well; their settings decide where the output goes.

Example: cycle start and stop

Call one macro at the start of every program, right after the O number, and another just before M30:

O9010 (CYCLE START MACRO)
POPEN
DPRNT[(***CYCLESTART***)]
PCLOS
M99
O9011 (CYCLE STOP MACRO)
POPEN
DPRNT[(***CYCLESTOP***)]
PCLOS
M99

If your programs already start with a fixed G code or end with M30, a parameter of the control can make that code call the macro, so the programs themselves need no change. The parameter numbers differ between Fanuc models; the control's manual lists them.

Example: tool numbers and probe values

A macro called at a spindle start can print the tool number, for example DPRNT[TOOLCHANGE=#4120[40]]. A probing cycle can print each result: DPRNT[(***ACTUALX=#28[44]***)] sends the value of variable #28 with four digits before and four after the decimal point. The help has a complete probe example.

Machines without Macro B

Cycle start and stop can still be recorded. A small relay on the signal that lights the in-cycle lamp switches an unused handshake line of the RS-232 cable, pin 8 (DCD). DNC Precision watches the line, ignores short bounces if you set a debounce interval, and can ignore it while a program is being sent, for controls that switch the lamp off during a transfer.

Monitoring and DNC on one port

The same port carries programs and monitor messages. DNC Precision keeps the two apart, as long as monitor messages use another format than the commands of the server mode. It can also log when a program is sent or received and which requests the operator made, and an operator can sign in from the control with an operator-name command, so the records show who ran the machine.

Editions

The machine monitor is part of DNC Precision Enterprise; Professional and the Free Edition send and receive programs but do not log machine activity. If you only need to record what a control prints, without sending programs, a serial data logger such as Advanced Serial Data Logger from the same developer does that. Compare the editions.

Questions

What is DPRNT? A Fanuc Custom Macro B command that prints text and variable values from a running program to an output port. With POPEN (open the port), DPRNT (print) and PCLOS (close the port), a program can send cycle start and stop, tool numbers, part counts or probe results to a PC over RS-232.

How do I know if my Fanuc control has Macro B? In EDIT mode, type POPEN and press INSERT. If the control shows the word as you typed it, the option is there. If it puts spaces between the letters (P O P E N), the control does not know the command.

Can I monitor a machine that has no Macro B? Yes, cycle start and stop: a small relay on the signal of the in-cycle lamp switches an unused handshake line of the RS-232 cable (pin 8, DCD), and DNC Precision records when the line changes. Tool changes and values need DPRNT.

Which edition of DNC Precision includes the machine monitor? Enterprise. Professional and the Free Edition send and receive programs but do not log machine activity.

Where does the logged data go? To a log file with the date and time of each event, and through export plugins to Excel, CSV files or SQL databases, with the columns you assign.

What is DNC software | DNC server mode | Drip feed | RS-232 troubleshooting | Wireless DNC | USB-to-serial adapters | Machine data with DPRNT | DNC software compared | Edit programs before sending | CNC and DNC settings | RS232 pinout and signals

Product Buy Download Support Contacts Site map
Copyright © 1999 - 2026, AGG Software.
All rights reserved.. Terms of use | Privacy policy