Skip to main content

Haas DPRNT

Haas machines do not expose certain information over MDC (Machine Data Collection) by default — things like operation names, job numbers, custom counters, or calculated values. To capture this extra information, the MachineMetrics Haas connector can receive data directly from the CNC program using DPRNT statements with a known prefix.

Version Requirement

DPRNT header support requires Haas Connector version 2.32.0.0 or above. Machines added after February 2024 have this version by default. If you need to confirm, contact MachineMetrics Support.

DPRNT constraints:

  • DPRNT must be the only command in the block (no other G/M codes on the same line)
  • Valid characters in the data value: A–Z, +, -, /, *, and space

Sending Program Headers via DPRNT​

The program header lets you pass an operation name from the CNC program to MachineMetrics. The connector uses the reserved prefix MMPHDR* to identify header messages.

CNC program syntax:

DPRNT[MMPHDR*OPERATION_NAME];

Replace OPERATION_NAME with the intended operation name (e.g., OP10, BORE_FINISH, PART_A).

Example:

DPRNT[MMPHDR*OP10_ROUGH_MILL];

Placement: The DPRNT statement can go anywhere in the program. By convention, place it near the top where it is easy to find and clearly associated with the executing program.

No adapter configuration is needed for program headers — the MMPHDR* prefix is recognized automatically.


Sending Generic Data via DPRNT​

For any other custom data (job numbers, operator IDs, process values, etc.), choose your own unique prefix and configure the adapter to map it to a data item key.

CNC program syntax:

DPRNT[MMPREFIX*DATA_VALUE];

Where MMPREFIX is any distinct prefix string you choose, and DATA_VALUE is the value to send. Use * as a word separator within the data value.

Example:

DPRNT[MMMYSTRING*This*is*my*data*string];

Adapter configuration:

Add a dprnt section to your Haas Serial adapter configuration in MachineMetrics, mapping each prefix to a data item key:

{
"dprnt": {
"MMMYSTRING": { "metricKey": "my_string_key" }
}
}

Sending Numeric Data via DPRNT​

Numeric values can be sent and typed explicitly so MachineMetrics treats them as numbers rather than strings. Set the type field to INTEGER or REAL:

{
"dprnt": {
"MMMYINT": { "metricKey": "my_int_key", "type": "INTEGER" },
"MMMYREAL": { "metricKey": "my_real_key", "type": "REAL" }
}
}

DPRNT on Next-Gen Controls (NGC)​

On Next-Gen Controls, DPRNT and MDC are served on separate ports. MachineMetrics handles this by running two data collectors on the same machine.

Step 1 — Configure the NGC Control​

Before MachineMetrics can receive DPRNT data, the NGC control must be configured to transmit it over TCP. Navigate to Settings on the Haas control and set the following:

SettingValuePurpose
Setting 261PortEnables DPRNT output over TCP (vs. serial)
Setting 2638001Sets the TCP port DPRNT data is transmitted on

The location of these settings varies by model — they are typically found under the I/O or Network settings tab.

note

These settings are specific to NGC controls. Classic controls do not use Settings 261/263 — they transmit DPRNT over the physical RS-232 serial port via the Moxa converter.

Step 2 — Configure MachineMetrics​

Add a Haas Serial adapter with mdcEnabled: 0 and connect it to [MACHINE-IP]:8001.

CollectorPurposeConfiguration
Collector 1MDC data (machine state, macro variables)Normal MDC connection — mdcEnabled: 1 (default)
Collector 2DPRNT data (program-injected values)mdcEnabled: 0 — connects to the DPRNT port (8001)

Configure the DPRNT collector by disabling MDC data collection and connecting to the DPRNT port:

{
"adapter": {
"mdcEnabled": 0
}
}

The DPRNT port is 8001 (as configured in Setting 263 above).