Heidenhain DNC
The Connectware implementation of the Heidenhain DNC protocol enables interaction with CNC machines over Heidenhain DNC. It supports:
Reading machine data and status information.
Editing tool and pocket tables.
Accessing data and files on the machine’s filesystem.
Each machine connection consists of:
Connection settings: How Connectware connects to the machine.
Data mappings: How Heidenhain data is mapped to MQTT topics.
Cybus Heidenhain Agent
To access the Heidenhain DNC COM component, Connectware uses the Windows-based Cybus Heidenhain Agent, which runs as a Windows service.

The Cybus Heidenhain Agent implements the Heidenhain RemoTools SDK, exposing a Microsoft COM component for communication with Heidenhain DNC interfaces.
Installing the Cybus Heidenhain Agent
Download the Cybus Heidenhain Installer.
Run the installer.
After installation, enable/start the agent via the Windows Services console.
Optional: Configure the service to restart on failure.
Agent logs are available in Windows Event Viewer.
Service Commissioning File Specifics
This section explains the Cybus::Connection and Cybus::Endpoint configuration objects.
For a complete reference, see the example:
For an overview of the available connection and endpoint properties, see:
Data Mappings
Data mappings are defined in the Heidenhain Methods section.
Each mapping for a Heidenhain method specifies:
Communication pattern
Heidenhain method (e.g.,
setToolTableRow)
Every Heidenhain method provides one of the following access patterns:
subscriptionread(request/response) orwrite(as an alias)notification
Subscription
Use the subscribe pattern to poll a Heidenhain method at a fixed interval.
Example mapping
Payload format
The MQTT message of the output data will be sent to the topic as specified in the endpoint configuration (in the example: myCustomOutputTopic). See also topic property.
Message format
Read
The endpoint’s read property implements a request/response pattern. This enables you to request a machine action and receive a response.
It follows JSON-RPC 2.0 specification with the following exceptions:
The
methodis defined by theCybus::Endpoint(derived from the MQTT topic) and is not provided in the request.The
jsonrpcmember is ignored and currently not sent.
Send requests to the MQTT topic <endpointName>/req (e.g., setToolTableRow/req), and receive responses on <endpointName>/res.
Alternatively, configure the endpoint as write. The behavior is identical to read except that the request topic uses /set (responses still arrive on /res). In other words, write is just an alias for read.
The payload of the initial request message must be a JSON object as string, which must contain the params member as a JSON array (unless the method has no parameters anyway). The params member must be a JSON array with the method arguments listed as JSON values. The array of method arguments is passed on to the machine and is used depending on the Heidenhain machine method. The response message of reador write will contain the return value from the machine method as payload member result, or, if the method call failed, a payload member error which contains the error message.
Example mapping
MQTT payload
The MQTT request payload must be a valid JSON object and can contain the following properties:
id(optional): User-defined correlation ID which can be used to identify the response. If this property was given, its value will be returned in the return message.params: Array of parameters required for the used method. If the method requires no parameters, this property is optional.
Following the example mapping above (method: setToolTableRow), the request payload sent on topic setToolTableRow/req must be as follows:
This modifies the tool table row 1 and sets the field NAME of that row to REQUEST-EXAMPLE. The following response will be replied on topic setToolTableRow/res:
Since setToolTableRow returns void, the successful result is null.
Notification
Some Heidenhain methods provide a notification pattern, publishing messages when specific events occur.
Example mapping
Heidenhain Methods
These are the available Heidenhain methods. The examples are shown in pseudo-code to clarify input and output types. Each function name matches its corresponding method name (see examples).
Machine Information
isConnected
Indicates whether the CNC controller is currently connected to the agent. Returns true if the CNC controller is connected to the agent.
getVersion
Returns the version of the Heidenhain SDK that the agent uses to communicate with the machine.
getState
Retrieves the connection state of the CNC.
getNcUpTime
Returns the CNC up-time in minutes.
getMachineUpTime
Returns the machine up-time in minutes.
getSpindleRunningTime
Get the cumulative spindle run-time the spindle has been running since installation. Parameter is the identifier of the spindle.
getMachineRunningTime
Returns the total machine working time (in minutes) since installation.
getMachineState
Returns a JSON object with selected machine state information.
getAvailableInterfaces
Returns an object with key/value pairs for each known CNC interface. Values are 1 (available) or 0 (unavailable).
hasAutomaticInterface
Returns true if the Automatic interface is available for this CNC controller.
hasDataAccessInterface
Returns true if the DataAccess interface is available for this CNC controller.
hasErrorInterface
Returns true if the Error interface is available for this CNC controller.
hasFileSystemInterface
Returns true if the FileSystem interface is available for this CNC controller.
hasItncTableInterface
Returns true if the ItncTable interface is available for this CNC controller.
hasProcessDataInterface
Returns true if the ProcessData interface is available for this CNC controller.
hasAutomaticEvents
Returns true if the AutomaticEvents interface is available for this CNC controller.
hasDataAccessEvents
Returns true if the DataAccessEvents interface is available for this CNC controller.
hasErrorEvents
Returns true if the ErrorEvents interface is available for this CNC controller.
hasMachineEvents
Returns true if the MachineEvents interface is available for this CNC controller.
Tool and Pocket Table
getToolTableRow
Returns the tool table row for the specified tool ID (row number).
setToolTableRow
Writes a tool table row. Provide the tool ID and an object of key (column name) value pairs.
addLinkedToolTableRow
Creates the next empty tool table row and links the tool to the next empty pocket table ID.
removeTool
DEPRECATED: Alias of removeToolTableRow. Removes the given toolId from the tool table. Use removeToolTableRow instead.
removeToolTableRow
Removes the tool with the specified toolId from the tool table.
clearToolTableRow
Empties the row in the tool table identified by toolId.
getToolTableCell
Reads a single cell from the tool table. Parameters: tool ID and column name.
setToolTableCell
Writes a single cell in the tool table. Parameters: tool ID, column name, and value.
getLinkedToolId
Returns the tool ID linked to the specified pocket table ID (row number).
linkToolToPocketTable
Link tool to pocket table by specifying the pocket table ID (row number) and the tool ID to be linked.
unlinkToolFromPocketTable
Unlink tool from pocket table by specifying the pocket table ID of tool to be unlinked.
setLinkedToolTableRow
Set the next empty tool table row and link the tool to the specified pocket table ID.
getPocketTable
Reads the entire pocket table. Returns an array of objects, one per row.
getToolTableRowByPocketId
Returns the tool table row for the tool currently selected at the given pocketId.
removeToolTableRowByPocketId
Removes the tool table row for the tool currently selected at the given pocketId.
setTool
Sets the tool table entry at toolId to newToolRow. If pocketId is provided, this also links the tool to that pocket.
addLinkedToolTableRow
Set the next empty tool table row and link the tool to the next empty pocket table ID.
Data Access
setAccessMode
Set the access mode to gain access to protected data sub trees. Not available for iTNCs.
getValue
Reads a value.
setValue
Writes a value.
getPlcData
Reads PLC data.
File System
transmitFile
Sends a base64-encoded buffer to the CNC and stores it as a file at destinationPath.
receiveFile
Retrieves a file from the CNC as a base64-encoded string (not raw binary or text).
deleteFile
Deletes the file at the given path.
copyFile
Copies the file at sourceFilePath to destFilePath.
readDirectory
Lists entries in the directory at directoryPath. The returned JSON includes the resolved path (input argument plus potential prefix) and the entry list.
makeDirectory
Creates a directory at the specified path.
deleteDirectory
Removes the directory at the specified path. The directory must be empty.
deleteDirectoryRecursively
Recursively deletes all files and subdirectories at the path. Use with caution.
NC Program Handling
selectProgram
Selects or deselects an NC part program for execution.
stopProgram
Stops the active NC program.
cancelProgram
Cancels the execution of a stopped NC program.
setExecutionMode
Sets the execution mode.
startProgram
Starts or restarts the specified program.
getProgramStatus
Returns the current program execution status.
getDncMode
Returns the current DNC mode.
clearControl
Executes a Clear Control.
setOverrideFeed
Sets the feed override (percentage).
setOverrideSpeed
Sets the speed override (percentage).
setOverrideRapid
Sets the rapid override (percentage).
getOverrideInfoFeed
Gets the current feed override.
getOverrideInfoSpeed
Gets the current speed override.
getOverrideInfoRapid
Gets the current rapid override.
Custom Functions of the Cybus Heidenhain Agent
getAgentVersion
Returns the Cybus Heidenhain Agent version.
setTableMonitorInterval
For itnc530 and tnc426, sets the manual monitoring (polling) interval of the tool table.
getTableMonitorInterval
For itnc530 and tnc426, returns the manual tool-table polling interval.
setSdkMutexTimeout
Sets the special timeout ensuring thread-safe access to Heidenhain SDK methods (needed only for some itnc530 variants).
getSdkMutexTimeout
Returns the special timeout for thread-safe SDK access (needed only for some itnc530 variants).
Events
All event methods are available as subscribe operation with type: notify.
onToolTableChanged
Notification on any tool table cell change.
onToolChanged
Tool in spindle changed event. This event is fired by the CNC when a new tool is placed in the spindle or when the actual tool is removed from the spindle.
onStateChanged
Connection state changed event. Notifies the client application of the connection state changes of the CNC. (_IJHMachineEvents2::onStateChanged).
onDncModeChanged
Notifies when DNC mode changes.
onPocketTableChanged
Notification on any pocket table cell change.
onProgramChanged
Notification on execution switch to another program, subprogram, or macro.
onNcProgramChanged
Notification on a changed NC program. From _IJHAutomaticEvents3::OnProgramChanged and _IJHAutomaticEvents3::OnProgramStatusChanged. This event is fired when the CNC program execution status is changed. For itnc530 note that the iTNC 530 emits this event when a newly selected program is started and not when the program is selected.
Typically, this event will be emitted after the OnProgramStatusChanged programEvent DNC_PRG_EVT_STARTED.
onProgramStatusChanged
Notification on program execution status change.
Service Commissioning File (Example)
MQTT Examples
MQTT examples following the example device service commissioning file above.
Get SDK Version
Set tool table row
Get tool table cell
Last updated
Was this helpful?

