Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA Server

Previously, a colleague privately messaged me to create a tutorial on Siemens OPC UA. Recently, I have been quite busy and did not have time to set up the system for testing and verification. Today, I happen to have some free time, so I will create an article about Siemens OPC UA, covering both the OPC UA server and OPC UA client in two parts. This article focuses on the server aspect. If there are any descriptive issues, please feel free to provide feedback!Overview of OPC UAOPC UA is an open standard suitable for horizontal communication between machines and vertical communication from machines to the cloud. It supports a wide range of security mechanisms.Advantages of OPC UA Communication

  • Standardized interfaces and wide availability
  • Secure communication according to the protocol without additional hardware
  • Direct connection and communication across all automation layers
  • Clear and straightforward data interpretation
  • Simple Ethernet-based network using existing industrial Ethernet infrastructure
  • International standardized interfaces for easy machine integration

Experimental Environment for This ExampleMastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerSoftwareTIA V18UA Expert (third-party OPC client)HardwareCPU 1511-1PN V2.9 (The original firmware version of the CPU was relatively low and did not support OPC. It was later upgraded to V2.9. The firmware upgrade files can be downloaded from the official website, but you need a permissioned account to download export-controlled files. Generally, regular accounts cannot download it; I had to ask a colleague abroad for help with the download.)Installing UA ExpertThe installation package can be downloaded from the official website or from the comment section where I have organized it in a cloud drive. Feel free to download it if needed.Double-click the installation package to install, and click the Next button.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerCheck to agree and click Next.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerClick Next.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerSelect the installation path; I used the default and clicked Install.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerWait for the installation to complete… After installation, click Finish.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerThe software installation is now complete and quite simple.After installation, the desktop shortcut is as follows:Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerOpen UAExpert, and the following interface appears. Click OK.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerFill in the relevant information; you can fill it in arbitrarily, then click OK.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerSelect the update interval or choose not to update, then click OK.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerThe interface after opening is shown in the following image, which will be used to monitor the Siemens PLC OPC server.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerSiemens 1500 OPC UA Server ConfigurationThe OPC UA server mode of the S7-1500 is disabled. Switch to the CPU properties interface and select the general options for the OPC UA server to activate the OPC UA server.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerAfter checking to activate the OPC UA server, the following image appears. Click OK.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerSwitch to CPU properties – Runtime System License – OPC UA, and select the appropriate license type.Running the OPC UA server on the S7-1500 CPU requires a license, which is mainly divided into three categories:SIMATIC OPC UA S7-1500 SmallSIMATIC OPC UA S7-1500 MediumSIMATIC OPC UA S7-1500 LargeMastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerSwitch to CPU properties – OPC UA – General to set the OPC UA application name; the default name can be used. Note that the application name must be entered on the certificate, and if the application name is changed, the existing certificate must be regenerated.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerSwitch to CPU properties – OPC UA – Server options to set the server session count, port number, and other related parameters. The default values can be used if there are no special requirements.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerCreate a DB in the program and create some variables for testing. The DB needs to be checked to allow access from OPC UA.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerNo certificate is set here; the no-certificate mode is used.Compile the program and download it to the PLC.Open UAExpert, click Add Server, and the Add Server window will pop up, select Custom Discovery.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerDouble-click to add the server….. A new window will appear. Enter the IP address of the Siemens PLC and the previously mentioned port number. The following image shows the test PLC IP address. Click OK.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerThe following image shows the added server. In this example, select None-None.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerAfter clicking OK, the added server appears in the area shown in the following image.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerClick the connect icon, and a pop-up window will appear. Click Trust server certificate.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerClick continue, and you will see that the configured PLC has been added to the project.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerOpen PLC_1, and you can see the configured PLC variables. You can drag the variables to the right for monitoring.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerIf you need to access the variable addresses in the PLC, as shown in the following image, select a variable, and the detailed NodeId will be on the right.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerAs shown in the image above, the Code corresponds to NodeID ns=3;s=”OPCData”.”Code”Force the PLC variable, and you can see that the value in UAExpert is consistent with the PLC. Thus, the configuration test is complete.The Siemens official website also provides a detailed tutorial, which includes configurations for certificates, etc. I have organized it in the comment section; feel free to download it if needed.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerI have organized learning materials related to industrial control. Feel free to take what you need. Please save the resources to avoid link expiration; the links are in the comment section.Mastering Industrial Control: A Step-by-Step Illustrated Guide to Siemens PLC OPC UA ServerMastering Industrial Control: Siemens PLC Time Synchronization – NTPMastering Industrial Control: A Treasure Chest for Beginners – Full of Valuable ContentMastering Industrial Control: Siemens HMI Can Be Remote, Why Run Back and Forth to Press the Interface?Mastering Industrial Control: Direct Read and Write Operations on SQL Database with Siemens PLC

Leave a Comment