Sinumerik 840D SL Operate OPC UA 4 7
Sinumerik 840D SL Operate OPC UA 4 7
Sinumerik 840D SL Operate OPC UA 4 7
This document describes setup and configuration of OPC UA components on controllers with
software Operate 4.7 SP2 and communication with a remote PC. Instructions on OPC UA setup
and test with free SINUTRAIN versions are also included.
Note: For software Operate version 4.5 see Sinumerik 840D 828D OPC UA (SW 4.5).
IP Address is automatically set according to the HMI configuration, -X130 for NCU and PPU ‘Local
Area Connection 2’ for PCU 50.
Enter a username for the Administrator (2) of the OPC UA server on the controller, for testing it is
recommended to use ‘OpcUaClient’.
Enter and confirm the password for this user (3). For testing it is also recommended to use
‘OpcUaClient’.
Important note: Please ensure that the date and time on your HMI is correct, otherwise certificate
based OPC UA authentication does not work!
Shut down the controller and start it in service mode without HMI: When the SINUMERIK screen
is displayed during startup and the PCU base version at the bottom right, press key '3' and log in
as user auduser.
Download and install SinuTrain for SINUMERIK Operate V4.7 Ed.2 - Basic. If you accept all default
settings you are able to use the paths mentioned below.
Start SinuTrain and create one new machine f.i. ‘Lathe with driven tool…’, it is recommended NOT
to use the ‘DEMO-Lathe’ device.
Click [MENU SELECT] - [Setup] - ‘>’ [Licenses] - [All Options] - [Search], enter OPC, activate the
license and click [OK].
Copy ALL files from folder C:\Siemens\SinuTrain\SINUMERIK CNC-SW 840D sl 4.7 SP3
HF1\hmi\siemens\sinumerik\hmi\template\cfg\miniweb\ to folder
C:\Siemens\SinuTrain\SINUMERIK CNC-SW 840D sl 4.7 SP3
HF1\hmi\user\sinumerik\hmi\miniweb\cfg\
Open UAApplication.xml with a text editor and replace all ‘localhost’ entries in this file with the
IPv4 address of your PC.
File UserDataBase.xml contains entries for OPC UA user ‘OpcUaClient’ with Password
‘OpcUaClient’. This user is administrator of the OPC UA server and has the right to read and write
all items at the controller.
[processes]
PROC100= image:="C:\Siemens\SinuTrain\SINUMERIK CNC-SW 840D sl 4.7 SP3
HF1\hmi\siemens\sinumerik\hmi\miniweb\release\miniweb.exe", process:=MiniWebServer,
cmdline:="..\System ..\WWWRoot", startupTime:=afterServices,
workingdir:="C:\Siemens\SinuTrain\SINUMERIK CNC-SW 840D sl 4.7 SP3
HF1\hmi\siemens\sinumerik\hmi\miniweb\release"
Restart the machine from the SinuTrain Workbench and make sure that systemconfiguration.ini
still contains the additional process.
If configured correctly on startup of the machine now an additional command line window opens
that shows details about the activities of miniweb.exe. Do NOT close this window!
CONFIGURE USERS
When you run the free version of SinuTrain for SINUMERIK Operate V4.7 you do NOT have
access to the OPC UA configuration soft key at the controller. At a real controller it’s not possible
to directly add or change users To do so proceed as follows.
User information is defined between tags <USER and </USER>. An existing user belongs to
groups. All GROUP NAME Tags have an additional A1= entry with an encrypted value which are
automatically created by the miniweb OPC UA server.
To add user ‘OpcUaClient’ with Password ‘OpcUaClient’ add the following section to the end of
the file before </UserDataBase>.
Note that the PASSWORD entry is automatically removed by miniweb.exe after startup.
Membership to groups define the rights for the user. SinuReadAll and SinuWriteAll enable the
user to read and write all items. You can also define:
Make sure that TCP Port 4840 is opened in your Firewall. You can use our tool Device Port
Scanner to check if your controller is reachable via this port.
Note: Both programs require .NET Framework 4 components and run on newer Microsoft
Windows x86 and x64 OSes (>= Windows 7).
For OPC UA it is required that your PC trusts the Siemens certificate issued by your controller.
Therefore it is necessary that it is installed in the certificate store of your PC. As this is a self-
signed certificate it is NOT automatically installed. To install the certificate right click
CNCnetPDM.OpcUA.Client.exe or CNCnetPDM.OpcUA.SimpleClient.exe, select ‘Run as
Administrator’ and connect to your controller. This only has to be done once!
Start CNCnetPDM.OpcUA.Client.exe and enter the IP Address of your controller into textbox Node
(1).
Activate checkbox SW 4.7 (2) fields User name and Password show up with default entry
‘OpcUaClient’ for user name and password.
Click on the arrow in textbox Endpoints, you should see 3 entries, select
Sinumerik OPC UA OEM [None, None] [opc.tcp://IP-Address:4840] (3).
FIG 4: CNCnetPDM.OpcUA.Client
Now you can see details of the selected object in the upper right pane (2).
By dragging the item from the upper left pane to the empty area at the bottom of the dialog you
can add it to a subscription (3). If you now change the operation mode of your controller to AUTO,
MANUAL or MDI you can immediately see the results under ‘Value’. If you right click the item you
can change the sampling interval or remove it from the subscription.
Activate checkbox SW 4.7 (3) fields User name and Password show up with default entry
‘OpcUaClient’ for user name and password.
Click [Connect] you now should be connected to the OPC UA server on your controller.
Initially one item is activated. You can adjust that by changing the value in field ‘Active Items’ (1) to
a different value, up to 15 items are possible.
The predefined values under ItemID (2) are known to work well on Sinumerik 828 and 840D
controllers, of course you can change them according to your needs.
The last two items are 2 R Parameters (user variables) that are visible at the controller: [MENU
SELECT] - [Parameter] - [User Variable]. As these 2 items are writable you can change them
remotely.
When you click on [Read] (3) the values of all activated items are read from you controller and
displayed in the dialog.
By entering numeric values for the last two items and clicking on [Write] (4) you can change the
user variables at the controller.
Clicking on [Monitor] (5) adds all activated items to a subscription and shows their current value.
TROUBLESHOOTING
In case there are errors the program writes a log file which can be found in the folder where
CNCnetPDM OPC UA Client is installed. This log file contains detailed information about any
issues.
Make sure that the controller is reachable via the network and port 4840 is opened at the
controller and your firewall. Use our tool Device Port Scanner to check if communication works.
Verify that process miniweb.exe is started at the controller. On a SinuTrain setup check that an
additional command line window exists and one of the last lines contains ‘OPC UA Server started
successfully on IP-Address:4840’.
If no additional command line window opens at all, check that the required entries in section
[processes] of systemconfiguration.ini exist. If not, add them and restart the controller.
If the window is opened but there’s no line with ‘OPC UA Server started successfully on IP-
Address:4840’ check file OPC_UAApplication.xml.
If you see multiple lines in this window with text ‘BAILED OUT’ and error messages related to
files not found check that the additional entry for miniweb.exe in systemconfiguration.ini points to
the directory that contains miniweb.exe (search for it). You can also use the full path to
miniweb.exe instead of the relative path. If this does not help, navigate to the folder that contains
miniweb.exe, open subfolder \System and open file WebCfg.xml with a text editor. Verify that
uncommented lines with long path entries point to directories that contain the specific .xml files.
If you see error message ‘Connect failed Error: cannot add self-signed certificate to certificate
store’ on startup run the program one time as Administrator.
If the fields under Read Value in CNCnetPDM OPC UA Simple Client show up in red you are
connected as anonymous user that doesn’t have the right to read values. Check that you have
checkbox SW 4.7 enabled.
If you see error ‘Connect failed BadIdentityTokenRejected’ on SW 4.7 make sure that you use the
correct user name and password.