This highly configurable CNCnetPDM Alarm & Events (A&E) device driver for Siemens Sinumerik 840D controllers with OPC classic A&E interface enables constant monitoring and output of active and acknowledged alarms and events from these devices.
You can dynamically define the number of messages that should be output in case of an event and the their content on a per machine basis by an INI file that is automatically created with reasonable default values for each machine configured. This INI file also allows you to define your own name for error tag names.
FIG 1: Alarm output from a Sinumerik 840D controller
This device driver requires at least Version 188.8.131.52 of CNCnetPDM and also works with a free license. However, in this mode you only get one (the first) error from the controller output. With a valid license you are able to output up to 30 simultaneous errors reported by the A&E Server at the controller, see licensing for details.
Download the Sinumerik OPC classic A&E device driver, extract all content of sinumerikae_dll.zip into the folder where you have CNCnetPDM installed.
Edit CNCnetPDM.ini with a text editor and modify it as follows, leave all other values at their default:
AcquisitionMethod = 2 This driver uses unsolicited (event driven) communication.
PollInterval = 10 Define the interval (number of seconds) for checking if the device is connected.
ReconnectAfter = 15 Define after how many successful connection checks CNCnetPDM should try to reconnect to the A&E Server at the controller if the device changed its state from disconnected to connected. As the machine needs some time to start up the combination of PollInterval and ReconnectAfter should be long enough e.g. 10 x 15 = 150 sec. For older machines increase this value.
CollectStates = 0
CollectCounters = 0 If you do not switch off these items the driver reports values whenever it checks if the device is alive.
If you identify your controller by IP address change it from 127.0.0.1 to its correct address e.g. 192.168.1.100.
If you identify your controller by DNS-Hostname change it from localhost to its correct value e.g. SINUMERIK01.
Change the name of the device driver from device.dll to sinumerikae.dll
Start CNCnetPDM as user ‘auduser’ (Shift key + right click CNCnetPDM.exe -> Run as different user), foreground program is sufficient (Start thread)
CNCnetPDM automatically copies the original sinumerikae.dll and appends the machine number as configured in the INI file, e.g. sinumerikae_1001.dll for machine 1001.
In addition an INI file with the same name is automatically created by the device driver, e.g. sinumerikae_1001.ini for your first machine.
Double click CNCnetControl, if your device number is 1001 and the device name is SINUMERIK #1 the output should be similar to the one below:
FIG 2: CNCnetControl Alarm & Events (Sinumerik)
Here the machine (1) shows up as connected (2) which is good. If you click on [CLOSE] followed by [OPEN] and there are active errors at the controller you can see data on the right side (3):
The line starting with O contains errors at the controller with its activated items as defined in the INI file of the device. If you didn’t change the INI file you get something like the following:
1001 12/06/2023 02:24:40 PM 10000000004 O ERR01|12470(1) NACK Channel 1 block N120 unknown G function G122 used|
Every error has a tag name followed by its activated items. The tag name is built by a prepending text here ERR followed by its sequential number here 01. If multiple simultaneous errors are reported this number increases. Tag name and items are delimited by pipe ‘|’ symbols. This allows CNCnetPDM to create OPC UA, MTConnect or SQL Database output for every alarm.
SETUP BACKGROUND SERVICE
To run CNCnetPDM as a background service for controllers with OPC Classic A&E interface the service mandatorily has to run under the ‘auduser’ user account. To setup a CNCnetPDM background service proceed as follows:
Right click CNCnetPDM, select ‘Run as Administrator’
Click button [Install]
In the following dialog, section Service Account enter a . (dot) followed by a backslash and username auduser e.g.: .\auduser
Enter the password for user auduser twice and click button [Ok], the dialog closes. Do not start the service.
As user ‘auduser’ does NOT have the right to ‘Log on as a service’ one additional step is needed.
Open a command prompt with elevated privileges (Run as administrator) and type in secpol.msc.
Navigate to Security Settings -> Local Policies -> User Right Assignment.
Open ‘Log on as a service’ and add user ‘auduser’.
Now you should be able to start the background service without any issues.
This device driver enables to dynamically modify, enable or disable error items and change the tag name prefix for errors. The INI file automatically created by the device driver for every machine contains sections that allow you to control its behavior.
Section [GENERAL] contains information about global parameters used by the driver on startup. Commands defines the maximum number of simultaneous errors present at the controller that should be output by the driver, default = 5, max. = 30.
Section [ALARMS & EVENTS] contains definitions if and how error items should be output:
Prefix for error tag names, default ERR
Should error description be output 0 = no, 1 = yes, default 1
Max. length of the error description, default 25 characters
Should the active state of the error be output 0 = no, 1 = yes, default 1 NACK = Not acknowledged, ACK = Acknowledged
Should error number be output 0 = no, 1 = yes, default 1
Should the event source e.g. PLC or part-program be output 0 = no, 1 = yes, default 0
Should the severity value (1-1000) of the error be output 0 = no, 1 = yes, default 0
Should the time since when the error is active be output 0 = no, 1 = yes, default 0
FIG 3: Names and description of error items
Note: To change the tag name prefix or switch items on or off 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
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 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, DNS Hostname or IP Address is wrong.
If the machine also shows a red icon, state disconnected but you do not see any output even there are errors present at the controller the machine is reachable but the A&E device driver is not able to connect to the A&E Server at the controller. In this case, check your controller setup and the parameters used in section [RS232] of CNCnetPDM.ini. Please use the tool AEClient.exe to check if you are able to connect to the A&E Server and get data.
If you do get a numeric device state in regular intervals but no errors please make sure that entries CollectOrders, CollectQuality and CollectFeeder are set to 1 in section [General] of CNCnetPDM.ini and CollectStates and CollectCounters are set to 0.
If specific alarm items are not acquired check first with AEClient.exe that you get output. Also make sure that the item in the device drivers INI file is activated (1), inactive items are not acquired.
If you already have a previous version of the driver installed and would like to upgrade to the most recent version proceed as follows:
Stop any CNCnetPDM background service or foreground program that uses the device driver
Extract all content of sinumerikae_dll.zip into the folder where you have CNCnetPDM installed, overwrite the existing files
Delete all sinumerikae_NNNN.dll and ClientAPIAE_NNNN.dll (NNNN = machine number) files. If you already have created adapted INI files for specific devices do NOT delete the sinumerikae_NNNN.ini files.
After restarting CNCnetPDM upgraded device driver versions for all machines are automatically created.