Cookies are important for this site to function properly, to guarantee your safety, and to provide you with the best experience. By clicking OK, you accept all cookies. For more information, please access our Privacy Policy.
Table of Contents
Tutorials / 
How to Exchange Data Between Siemens PLCs and SCADA Using CIP Protocol
Advanced

How to Exchange Data Between Siemens PLCs and SCADA Using CIP Protocol

Siemens
SCADA
TIA Portal
HMI Development

‍Introduction

Siemens PLCs frequently communicate with other PLCs, peripheral devices, and advanced control systems, including Supervisory Control And Data Acquisition (SCADA) and Manufacturing Execution Systems (MES). This communication is essential for controlling various components within an industrial automation environment. Effective communication ensures that data is accurately and reliably exchanged between devices, enabling seamless operation and monitoring of processes.

To achieve this level of integration and interoperability, all involved parties must use the same communication protocol. Using a standardized protocol ensures compatibility, reduces the potential for communication errors, and simplifies the configuration and maintenance of the system.

Figure 1.1 shows a basic configuration for using CIP/PCCC as the protocol for executing this data exchange, as demonstrated by the following application example.

Figure 1.1: PLC and SCADA communication - Basic configuration overview
Figure 1.1: PLC and SCADA communication - Basic configuration overview

Prerequisites

What you will need to follow along with this tutorial:

Principle of Operation

The Client-Server model governs how communication occurs with CIP/PCCC. The Siemens PLC is responsible for the CIP server within this application. The Siemens PLC provides the CIP client with process data by implementing the designated function block.

WinCC is used in this application example to set up the CIP client, offering several options for connecting to Siemens PLC and external systems through various communication drivers. This example, specifically, utilizes the EtherNet/IP driver.

The CIP client initiates the process by establishing a connection with the CIP server and then requests the necessary data to be displayed on the screen. Additionally, this application allows for modifying process values within the Siemens PLC, enabling real-time adjustments and control over the processes managed by the PLC.

Figure 2.1: PLC and SCADA communication - Operation principle
Figure 2.1: PLC and SCADA communication - Operation principle

Engineering and System Setup

Open the TIA Portal software on your computer. Once the software is running, start by creating a new project. After initiating the new project, proceed by configuring the hardware settings necessary for the application example provided in this tutorial.

Figure 3.1: PLC and SCADA communication - Hardware configuration of the project
Figure 3.1: PLC and SCADA communication - Hardware configuration of the project

Download the CIP Server library from this link. Go to the right-hand side of the software environment and open the ‘Libraries’ task card. Expand the Global Libraries tab and click the Open Global Library icon to open its window. When the pop-up window opens, locate and select the downloaded CIP Server library.

Figure 3.2: PLC and SCADA communication - Importing CIP server library
Figure 3.2: PLC and SCADA communication - Importing CIP server library

After you have inserted the CIP Server library, drag and drop the relevant data types and the associated function block into their designated folders within the Siemens PLCs. It ensures that all necessary components are correctly organized and integrated into the system for proper functionality.

Figure 3.3: PLC and SCADA communication - Integrating CIP server library into the project
Figure 3.3: PLC and SCADA communication - Integrating CIP server library into the project

Access the main organizational block. The programming interface will then display a blank rung. Proceed by inserting the CIP Server function block into the Main [OB1]. A pop-up window will appear requesting the instance data block. Assign it the name ‘InstCIPServer.’

Figure 3.4: PLC and SCADA communication - Calling CIP server function block into the Main [OB1]
Figure 3.4: PLC and SCADA communication - Calling CIP server function block into the Main [OB1]

To facilitate communication, use the CPU's embedded PROFINET Interface by assigning the precise parameter to the block call. The result of configuring the PROFINET Interface with the appropriate settings is that you enable efficient and accurate data exchange between the Siemens PLC and other connected devices.

Figure 3.5: PLC and SCADA communication - Assigning the precise parameter to the block call
Figure 3.5: PLC and SCADA communication - Assigning the precise parameter to the block call

Because the internal addressing method used by Siemens PLC for process tags does not match the requirements of the PCCC services, it is necessary to implement a mapping procedure. This mapping aligns the Siemens PLC address structure with the format expected by the PCCC services, ensuring accurate communication and data exchange between the systems.

In the mapping, there might be multiple files of a particular type. Each file's size is pre-established and unchangeable. Here are the instructions for setting up the mapping.

Generate a brand-new global data block (DB) and assign it the name 'Mapping.' Once the data block has been created, it will automatically open in the DB editor for further configuration and editing.

Figure 3.6: PLC and SCADA communication - Creating global data block for the mapping procedure
Figure 3.6: PLC and SCADA communication - Creating global data block for the mapping procedure

Set up a DB variable identified as 'Type N.' A fresh variable, structured with 100 elements and including a file number variable, will be given to you. Specify the file number you want to use. The default for N-files is set to 7. Next, compile the database you've created.

Figure 3.7: PLC and SCADA communication - Creating the type N variable within mapping DB
Figure 3.7: PLC and SCADA communication - Creating the type N variable within mapping DB

Ensure the variable is allocated to the CIP Server block with the 'nFiles' formal parameter. Any different assignment will trigger an error during server startup, thus completing the single file parameter assignment.

Figure 3.8: PLC and SCADA communication - Allocating the type N variable to the CIP server function block
Figure 3.8: PLC and SCADA communication - Allocating the type N variable to the CIP server function block

If you have several files, you can allocate an array of them to the corresponding formal parameters. The memory capacity of the CPU module is the only factor limiting the maximum size of a file array since the CIP Server block doesn't impose restrictions.

Figure 3.9: PLC and SCADA communication - Creating the type F variable within mapping DB
Figure 3.9: PLC and SCADA communication - Creating the type F variable within mapping DB
Figure 3.10: PLC and SCADA communication - Allocating the type F variable to the CIP server function block
Figure 3.10: PLC and SCADA communication - Allocating the type F variable to the CIP server function block

Configuration of the CIP client is required before it can retrieve the mapped data. Navigate to the Connections section of the HMI panel. The editor for Connections will display. Introduce a new Allen-Bradley EtherNet/IP connection. Thus, a new connection by the name Connection_1 is formed. Adjust the connection configuration. Assign 'SLC, MicroLogix' as the CPU type. Assign the IP address to match the S7-1200 Siemens PLC IP. Keep the communication path set to: '1,0.' The connection now functions as an EtherNet/IP link with the CIP/PCCC protocol.

Figure 3.11: PLC and SCADA communication - Introducing an Ethernet/IP connection
Figure 3.11: PLC and SCADA communication - Introducing an Ethernet/IP connection

Establish a new directory for HMI tags through the emulated SLC connection. Name the newly created folder as 'emulatedSLC_1200.' Introduce new tags within the recently created directory. Set [N7:0] as the address. Select 'Connection_1' as the connection. Assign 'N' as the file type, '7' as the file number, and '0' as the element number.

Figure 3.12: PLC and SCADA communication - Creating an HMI tag for temperature setpoint
Figure 3.12: PLC and SCADA communication - Creating an HMI tag for temperature setpoint

Carry out the prior step for other tags: speed setpoint, Integer type, with the address of N7:19, and current temperature, Real type, with the address of F28:2. The mentioned tags are currently available to be utilized in your application's screen.

Figure 3.13: PLC and SCADA communication - Creating HMI tags for speed setpoint and current temperature
Figure 3.13: PLC and SCADA communication - Creating HMI tags for speed setpoint and current temperature

Develop your HMI interface and embed the tags into it. Without an S7 connection between the PLC and the Panel, as you've seen, it resorts to EtherNet/IP for reading and writing the variables in the PLC.

Figure 3.14: PLC and SCADA communication - Developing temperature setpoint within the HMI interface
Figure 3.14: PLC and SCADA communication - Developing temperature setpoint within the HMI interface
Figure 3.15: PLC and SCADA communication - Developing speed setpoint within the HMI interface
Figure 3.15: PLC and SCADA communication - Developing speed setpoint within the HMI interface
Figure 3.16: PLC and SCADA communication - Developing current temperature gauge within the HMI interface 
Figure 3.16: PLC and SCADA communication - Developing current temperature gauge within the HMI interface 

Execution and Testing

After downloading the PLC program to the PLC, proceed by activating the CPU module's RUN mode by clicking on the Start CPU icon located in the top toolbar. This action initiates the execution of the PLC program within the CPU module, ensuring that the system begins operating as configured.

Figure 4.1: PLC and SCADA communication - Activating the PLC CPU’s module run mode
Figure 4.1: PLC and SCADA communication - Activating the PLC CPU’s module run mode

The CIP Server block is currently running and is set to IDLE mode without establishing any interaction with partners. For this setup, you must activate the CIP server, and the optimal method is to create a watch table and name it 'watch CIP Server.' Populate the watch table with variables based on your configuration settings.

Figure 4.2: PLC and SCADA communication - Creating the CIP server watch table
Figure 4.2: PLC and SCADA communication - Creating the CIP server watch table

Ensure the 'enable' input of the CIP Server block instance is set to TRUE.

Figure 4.3: PLC and SCADA communication - Enabling the CIP server function block
Figure 4.3: PLC and SCADA communication - Enabling the CIP server function block

If the setup is correct, the status data will reflect busy and valid parameters marked as TRUE, the error parameter marked as FALSE, and the status parameter showing 16#0000.

You may proceed to edit the values in the watch table. Confirm that the updates have been applied successfully to the WinCC Runtime Advanced or the Panel you worked with. The tags being read from the PLC are indicated by this communication.

Figure 4.4: PLC and SCADA communication - Reading tags from the PLC by SCADA
Figure 4.4: PLC and SCADA communication - Reading tags from the PLC by SCADA

Adjustments to values can be made in the active Simulation or on the actual hardware of the Siemens Comfort Panel. Look at the program to confirm that your edits are visible in the watch table since this reflects the communication's writing flow.

Figure 4.5: PLC and SCADA communication - Writing tags to the PLC by SCADA
Figure 4.5: PLC and SCADA communication - Writing tags to the PLC by SCADA

Conclusion

In conclusion, you learned how to set up and execute data exchange between Siemens PLCs and SCADA systems using the CIP/PCCC protocol. This tutorial guided you through the necessary steps, including software prerequisites, configuring the CIP server and client, setting up the communication mapping, and establishing EtherNet/IP connections. You also learned how to create and configure HMI tags and interfaces, download and run the PLC program, and verify successful communication and data exchange between the PLC and the SCADA system. With these skills, you can effectively manage and monitor Siemens PLCs using SCADA. Keep in mind that you're likely to see a Manufacturing Execution System (MES) on top of the SCADA