News CNCnetPDM About us Support  
OPC UA Device Driver | Siemens | Support | inventcom



The CNCnetPDM OPC UA device driver allows reading, writing and monitoring of machine-, process- and quality data from Siemens Sinumerik 840D & 828D controllers that run HMI software Operate. Reading and monitoring can be performed in solicited (time controlled) or unsolicited (event driven) mode.

CNCnetPDM OPC UA IoT Interfaces

OPC UA IoT Interfaces



  • Enables simultaneous communication with multiple Siemens Sinumerik OPC UA Servers by a single instance of CNCnetPDM
  • Different controller types (e.g. Fanuc, Heidenhain, Haas, Mazak, Okuma) can be mixed with this device driver within one service instance
  • Outputs data to various databases, MTConnect compatible programs or your own applications (f.i. with our Free Open Source Client)
  • Allows definition of individual sets of data acquisition items on a per-machine basis


  1. Please make sure that your device is properly setup and you can communicate with it by our utility tool CNCnetPDM OPC UA Client
  2. Microsoft .NET 4.5.1 has to be installed on your PC
  3. Firewall at your PC has to be switched off or an exception for the TCP port the OPC UA server uses (Default: 4840) has to be added, check access to this port with our Device Port Scanner 



Download CNCnetPDM and install it as described in the quick-start-guide.

Download the CNCnetPDM OPC UA device driver, extract all content of into the folder where you have CNCnetPDM installed.

Open CNCnetPDM.ini with a text editor.

In section [GENERAL] set AcquisitionMethod = 1 to read data from the OPC UA server by polling it in a time interval (solicited messaging).
For reading based on events at the OPC UA server (unsolicited messaging) set AcquisitionMethod = 2.

For solicited messaging set PollInterval to the interval (seconds) for polling data from the device.

For unsolicited messaging set PollInterval to the interval (seconds) for checking if the device is connected (alive).

In section [RS232] add a new device as described in the quick start guide point 7. Change the line as follows:
2 = 1000;19200;8;N;1;DEVICE #2;;0;0;DNS Hostname;0;0;none;none;1;opcua451.dll

2 = 1000;19200;8;N;1;SINUMERIK #1;;0;0;DNS Hostname;0;0;none;none;1;opcua451.dll

Adjust IP Address or DNS Hostname according to the setup of your device.

The number before opcua451.dll defines how the default INI file for the device will be created: 1 creates an INI file for Siemens Sinumerik 840D & 828D controllers that use namespace index 2 (String).

Note: The CNCnetPDM OPC UA Client outputs the namespace used by your device if you click on a node in the OPC UA browser and check the value for namespace index in the right area.


  • Start CNCnetPDM, foreground program is sufficient (Start thread)
  • CNCnetPDM automatically copies the original opcua451.dll and appends the machine number as configured in the INI file, e.g. opcua451_1000.dll for machine 1000
  • In addition a device INI file with the same name is automatically created by the device driver, e.g. opcua451_1000.ini for machine with device number 1000
  • Stop CNCnetPDM
  • Open the device INI file with a text editor and adjust all values in sections [GENERAL] and [SECURITY] as described in chapter ‘ADJUST ITEMS
  • Start CNCnetPDM again
  • Double click CNCnetControl, if your device name is SINUMERIK #1 the output should be similar to the one below:

FIG 1:    CNCnetControl (OPC UA device driver)

Here the machine (1) shows up as connected (2) which is good. On the right side (3) you see the acquired data:

  • The line starting with O contains items defined in the INI file of the device that should be output to section 1. If you didn’t change the INI file you get something like the following:

1000 12/02/2023 01:05:57 PM O STATN| 2| STATT| Producing| MODEN| 2| MODET| AUTO| PRGSN| 3| PRGST| Started|  10000000015

Every item has a description (Tag name) followed by its value (Tag value). All descriptions and values are delimited by pipe ‘|’ symbols. This allows CNCnetPDM to create database records or MTConnect output for every item.


For SIEMENS SINUMERIK 840D & 828D CONTROLLERS the initially configured items are:






Automatic mode (numeric)



Program status (numeric)



Part counter (numeric)



OEE Device state (numeric)



OEE Device state (text)



Device mode (number)



Device mode (text)



Program state (number)



Program state (text)



Name of the selected program



Stop condition



Channel status



Tool number



Spindle speed



Override spindle percent



Actual feed rate



Override feed



Actual part count



Required parts



Active M functions



Value of R variable 1



Value of R variable 2

FIG 2:    IDs, names and description of items (Siemens Sinumerik 840D & 828D controllers)


To setup a CNCnetPDM background service proceed as follows:

  • Right click CNCnetPDM, select ‘Run as Administrator’
  • Click button [Install]
  • Check ‘Automatic Startup’ if the service should start automatically
  • In dropdown field ‘Depends on service’ you can select a service that has to be started before CNCnetPDM starts (e.g. a database service)
  • Leave all fields in section ‘Service Account’ blank.
  • Click button [Ok], the dialog closes.
  • You can now click button [Start] to manually start the service.

See also: Setup CNCnetPDM as a background service


This device driver enables to dynamically add, group, enable or disable items and change their names. The INI file automatically created by the device driver for every machine contains sections that allow you to control its behavior.


This section contains information about global parameters used by the driver on startup.

‘Commands’ defines the number of OPC commands you’d like to execute, maximum value = 30.

‘Server port’ defines the TCP port number of the OPC UA Server at the device, typically 4840.

‘Sampling rate ms’ sets the sampling rate for unsolicited messaging, default = 500, minimum = 100.

‘Operation timeout ms’ defines the time after which the driver assumes that the device is not alive and disconnects.

‘Namespace index’ is the numeric namespace index used by the OPC UA Server (Siemens Sinumerik = 2).

‘Identifier type’ is the identifier type used by the OPC UA server, ‘String’ or ‘Numeric’ (Siemens Sinumerik = String).

‘Username’ and ‘Password’ define the credentials that the driver uses to access the OPC UA Server if anonymous access is disabled

‘No authentication’ can be set to 1 if the driver should use anonymous, non-secure access to the OPC UA server, default 0.

‘Server type’ defines how the driver detects OEE machine states, set this to 1 for Sinumerik CNCs.


This section contains information about the OPC UA security mode and policy of the endpoint that the driver should access.

‘Security mode’ can either be None, Sign or SignAndEncrypt.

‘Security policy’ can either be None, Basic128Rsa15, Basic256 or Basic256Sha256.

Note: Please use the security mode and policy as detected by the CNCnetPDM OPC UA Client for your device.


OPC Items you query are organized in sections e.g. [2]. Every section contains entries where you can define names and parameters for a specific OPC item. Unless otherwise instructed do NOT change sections [0] and [1].

Description of the numeric sections:




Section identifier, numbers starting with 0 are queried


If you set this to 0 the command is not executed


A short name (max 5 characters) to describe the item e.g. STATN for status number


A comment that describes the command (optional)


OPC command to be executed e.g. ‘/Channel/State/progStatus’ for identifier type ‘String’ (Sinumerik). The command ‘cnc_oeestate’ executes several OPC commands and calculates output relevant for OEE, see section ‘Output item’ and chapter ‘Commands’ below.

Output item

For normal OPC commands this is NOT needed. Only for command ‘cnc_oeestate’ you can enter the values described in chapter ‘Commands’ below.

Output section

You can output data to 3 sections that may contain up to 256 characters. 1 goes to section ‘O’, 2 to ‘A’ and 3 to ‘F’. If data in one section exceeds the maximum length you can send items to a different section. Make sure you have entries CollectOrders, CollectFeeder and CollectQuality enabled (=1) in CNCnetPDM.ini.

FIG 4:    Description of a device INI file section

Note:   To change commands, switch items on or off or alter its name while CNCnetPDM is running open the INI file with a text editor such as notepad, make the desired changes and save the file. To apply the changes immediately you can click on the machine in CNCnetControl on the left side followed by clicking buttons ‘Close’ and ‘Open’ above the section ‘Devices’.


Here you can find information about commands and output items that can be used with this driver. In general you can use all OPC UA items output by the CNCnetPDM OPC UA Client with the driver. Also see the ‘Parameter Manual’ of your controller for details or contact us if you need help.

Command cnc_oeestate

This special command is not a real OPC item like ‘/Channel/State/progStatus’. It uses the output of command[0] = ‘Device Mode’ and command[1] = ‘Program State’ to calculate output relevant for OEE. It also translates numeric output of specific OPC queries into text.






Numeric OEE state of the device (2 = producing, 3 = manual, 4 = interrupted, 5 = error)



State of the device as text (producing, manual, interrupted, error)



Numeric running mode of the controller (0 = JOG, 1 = MDA, 2 = AUTO)



Running mode of the controller (text output)



NC program state (numeric) (0 = Undefined, 1 = Interrupted, 2 = Stopped, 3 = Started, 4 =Waiting, 5 = Aborted)



NC program state (text)

FIG 5:    Description of command ‘cnc_oeestate’


CNCnetPDM for Siemens Sinumerik 840D & 828D OPC UA Servers also supports writing and changing of data on these devices from a remote PC. Although writing of ALL writable OPC items is supported it is highly recommended to start with simple commands like changing ‘R variables’. For Siemens Sinumerik 840D & 828D you can proceed as follows:

With an unmodified INI file CNCnetPDM queries two ‘R variables’, section [20] = ‘R variable 1’, section [21] = ‘R variable 2’. To change the value of these 2 variables CNCnetPDM has to be running and you should see data for RVAR1 and RVAR2 via CNCnetControl, section ‘F’.

To change the value of a parameter first click on the device in the left area (1). Then click on button [Command] (2). In the drop down box below number (3) select or input 21. Enter a new numeric value into the text box below command text (4) here 1500.33. Click button [OK] (5). You can see the new value in the ‘Device Data’ area in the right pane.

FIG 6:    Change R-Variable on Sinumerik controller with OPC UA server

All successful write actions and errors are written to the device’s log file in subfolder \log.


  • For correct setup of the CNCnetPDM OPC UA device driver it is highly recommended to start with the CNCnetPDM OPC UA Client and use its output to define correct commands in your device INI file.

  • To get correct output of OEE device states please make sure that you use a command for section 0 in your device INI file that outputs the device mode and one for section 1 that outputs the program state.

  • If OEE device states are incorrect you can set CollectStates = 0 in CNCnetPDM.ini and calculate the values by your application program. To do so you can use different commands for section 0 and 1 and define an output section other than 0 for them.

  • If your device does not output part counter values set Active = 0 for section 2 in your device INI file.

  • OPC items on Siemens Sinumerik 840D & 828D OPC UA Servers are case sensitive, for example NC program status has to be queried with /Channel/State/progStatus, if you use /Channel/State/PROGSTATUS you get an error.

  • If you want to add additional items (up to 30 in total) first adjust the number of commands in section [GENERAL]. Then, copy and paste the last numeric section and do not forget to adjust the section number and its content!

  • In case you use the device driver in unsolicited mode and you query items that change very fast e.g. Axis position it is recommended to use higher values for the sampling rate.


This device driver requires the most recent version of CNCnetPDM and also works with a free license. However, in this mode you only get output for the first item configured in your INI file. With a valid license you are able to output the result of up to 30 commands per reading cycle, see licensing for details.


  • The device driver writes a log file entry for any communication issue to the log file of the device. The file can be found in subdirectory \log of your CNCnetPDM program folder. The file format for the log file is log_ + device number + _ + date.txt. Please check this file first if you observe an issue.

  • If the machine shows a red icon, state disconnected and you get just output E = 0 the machine is not reachable at all. This has nothing to do with the device driver, the controller is switched off, it’s a network issue or DNS Hostname or IP Address is wrong.

  • If the machine also shows a red icon, state disconnected but you just get output E = 1 the machine is reachable but the controller does not respond to commands, check your controller setup and the parameters used in section [RS232] of CNCnetPDM.ini. Please use the tool CNCnetPDM OPC UA Client to check if you can access the OPC UA server of the device.
  • If you do get numeric device states but not any of the preconfigured items please make sure that entries CollectOrders, CollectQuality and CollectFeeder are set to 1 in section [General] of CNCnetPDM.ini.

  • If you defined an incorrect device INI file or messed it up you can simply delete it and switch the device off and on via CNCnetControl. The INI file then gets automatically recreated.

  • If specific items are not acquired check first with CNCnetPDM OPC UA Client if you can access the desired OPC UA node. Also make sure that the numeric section of the item in the device drivers INI file is activated and has an entry for ‘Name’, inactive or items with empty names are not acquired. Also check that you didn’t misspell entries for command and output item in your device driver INI file.


If you already have a previous version of the driver opcua451.dll installed and would like to upgrade to the most recent version proceed as follows:

  1. Stop any CNCnetPDM background service or foreground program that uses the device driver
  2. Extract all content of into the folder where you have CNCnetPDM installed, overwrite the existing files
  3. Delete all opcua451_NNNN.dll and ClientAPIUA451_NNNN.dll (NNNN = machine number) files. If you already have created adapted INI files for specific devices do NOT delete the opcua451_NNNN.ini files
  4. After restarting CNCnetPDM upgraded device driver versions for all machines are automatically created


If you are using the Sinumerik OPC UA device driver (sinumerikua.dll) and you would like to upgrade it to the OPC Standard UA device driver (opcua451.dll) proceed as follows:

  1. Stop any CNCnetPDM background service or foreground program that uses the device driver
  2. Extract all content of into the folder where you have CNCnetPDM installed
  3. With a text editor change all occurrences of sinumerikua.dll to opcua451.dll in section [RS232] of CNCnetPDM.ini
  4. Change the value before opcua451.dll to 1 e.g.: ;1;opcua451.dll
  5. After starting CNCnetPDM new INI files for all machines defined in section [RS232] of CNCnetPDM.ini will be created automatically e.g. opcua451_NNNN.ini (NNNN = machine number)
  6. Stop CNCnetPDM
  7. Change the values in sections [GENERAL] and [SECURITY] in the new INI file according to the output of the CNCnetPDM Standard OPC UA Client
  8. Replace all sections [0] -> [N] in this new INI file with the sections from your sinumerikua_NNNN.ini file
  9. Save the new INI file
  10. Start CNCnetPDM

Privacy notice

This website uses cookies. By continuing to use it you agree to our privacy policy.

Support | Siemens | Overview

CNCnetPDM enables to acquire machine, process, quality, event and alarm data from machines equipped with Siemens Sinumerik controllers and integrate it seamlessly with your... [read more]
Support | Siemens | Overview

Support | Siemens | Release Notes

(2/21/2024) We released a new IIoT Adapter device driver for Sinumerik 840D with HMI-Advanced or HMI-Embedded that runs... [read more]
Support | Siemens | Release Notes

Support | Siemens | DDE Device Driver

This highly configurable CNCnetPDM device driver for machines with Siemens Sinumerik 840D controllers enables to add OPC UA Server, MTConnect and SQL Database output... [read more]
Support | Siemens | DDE Device Driver

Support | Siemens | OPC Classic DA

CNCnetPDM OPC DA for Siemens Sinumerik 840D controllers enables you acquisition and monitoring of machine-, process- and quality-data from machines with Sinumerik controllers... [read more]
Support | Siemens | OPC Classic DA

Support | Siemens | OPC Classic DA Device Driver

This highly configurable CNCnetPDM device driver for Siemens Sinumerik 840D controllers with OPC classic enables you to monitor and output machine-, process- and quality data... [read more]
Support | Siemens | OPC Classic DA Device Driver

Support | Siemens | OPC Classic A&E

CNCnetPDM OPC Classic Alarm & Events (A&E) for Siemens Sinumerik 840D controllers enables you to monitor active and acknowledged alarms and events from your machines by a... [read more]
Support | Siemens | OPC Classic A&E

Support | Siemens | OPC Classic A&E Device Driver

This highly configurable CNCnetPDM Alarm & Events (A&E) device driver for Siemens Sinumerik 840D controllers with OPC Classic A&E Interface enables constant... [read more]
Support | Siemens | OPC Classic A&E Device Driver

Support | Siemens | OPC UA

CNCnetPDM OPC UA for Siemens Sinumerik Operate enables you to monitor machine-, process- and quality-data from Sinumerik 840D SL & 828D controllers from a remote PC. It also... [read more]
Support | Siemens | OPC UA
Modified: 2024-03-06