CIP Server DOC V1.0 en
CIP Server DOC V1.0 en
Disclaimer of liability
Siemens shall not assume any liability, for any legal reason whatsoever, including, without
limitation, liability for the usability, availability, completeness and freedom from defects of the
application examples as well as for related information, configuration and performance data and
any damage caused thereby. This shall not apply in cases of mandatory liability, for example
under the German Product Liability Act, or in cases of intent, gross negligence, or culpable loss of
life, bodily injury or damage to health, non-compliance with a guarantee, fraudulent
non-disclosure of a defect, or culpable breach of material contractual obligations. Claims for
damages arising from a breach of material contractual obligations shall however be limited to the
foreseeable damage typical of the type of agreement, unless liability arises from intent or gross
negligence or is based on loss of life, bodily injury or damage to health. The foregoing provisions
do not imply any change in the burden of proof to your detriment. You shall indemnify Siemens
© Siemens 2021 All rights reserved
against existing or future claims of third parties in this connection except where Siemens is
mandatorily liable.
By using the application examples, you acknowledge that Siemens cannot be held liable for any
damage beyond the liability provisions described.
Other information
Siemens reserves the right to make changes to the application examples at any time without
notice. In case of discrepancies between the suggestions in the application examples and other
Siemens publications such as catalogs, the content of the other documentation shall have
precedence.
The Siemens terms of use (https://support.industry.siemens.com) shall also apply.
Security information
Siemens provides products and solutions with industrial security functions that support the secure
operation of plants, systems, machines, and networks.
To protect plants, systems, machines, and networks against cyber threats, it is necessary to
implement – and continuously maintain – a holistic, state-of-the-art industrial security concept.
Siemens’ products and solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems,
machines, and networks. Such systems, machines and components should only be connected to
an enterprise network or the Internet if and to the extent such a connection is necessary and only
when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.
For additional information on industrial security measures that may be implemented, please visit
https://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure.
Siemens strongly recommends that product updates are applied as soon as they are available
and that the latest product versions are used. Use of product versions that are no longer
supported, and failure to apply the latest updates may increase customer’s exposure to cyber
threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed
at: https://www.siemens.com/industrialsecurity.
Siemens AG V1.0.0
Division Digital Factory Ⓟ 04/2021 Subject to change
Postfach 48 48
90026 NÜRNBERG Copyright © Siemens AG 2021.
Germany All rights reserved 2
Table of contents
Table of contents
Legal information ......................................................................................................... 2
1 Preface ................................................................................................................ 4
2 Introduction ........................................................................................................ 5
2.1 Description ........................................................................................... 5
2.2 Common Industrial Protocol ................................................................. 5
2.3 Programmable Controller Communication Commands ....................... 6
2.4 Function principle ................................................................................. 7
2.5 Scope of delivery .................................................................................. 7
3 Commissioning .................................................................................................. 8
3.1 Preparation ........................................................................................... 8
3.2 Connecting the hardware components ................................................ 8
4 Configuration/Engineering ............................................................................... 9
4.1 Creating and managing projects .......................................................... 9
4.2 Creating the server mapping .............................................................. 12
4.2.1 PCCC object ....................................................................................... 12
4.3 Setting up the CIP client ..................................................................... 20
4.3.1 Setting up the EtherNet/IP connection ............................................... 21
5 Operating .......................................................................................................... 24
© Siemens AG 2021 All rights reserved
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 3
1 Preface
1 Preface
Purpose of the manual
This document contains information about the LCCF_CIPServer function block for
SIMATIC S7-1200 and S7-1500. It will explain its usage and parameterization as
well as provide some background information about the implemented “Common
Industrial Protocol” as specified by the ODVA.
Core content
The following core issues are covered in this document:
• Purpose of the function block
• Parameterization
• Data exchange with a CIP client
Delimitation
© Siemens AG 2021 All rights reserved
Validity
This document is valid for the following components
• TIA Portal
• SIMATIC S7 Controller
The following hardware and software are used throughout this document
The screens in the Comfort Panel are created using the HMI Template Suite, which
can be downloaded using the SIOS ID: 91174767.
https://support.industry.siemens.com/cs/ww/en/view/91174767
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 4
2 Introduction
2 Introduction
2.1 Description
Often SIMATIC controller exchange data with other controller, peripheral systems,
and upper level control systems or with MES or SCADA systems. To do this in a
meaningful manner the communication partners need to use the same protocol.
The following application example demonstrates the use of CIP/ PCCC as the
protocol to perform this data exchange.
The simplified setup is shown below
CIP client
© Siemens AG 2021 All rights reserved
IE
SIMATIC S7-1200
SIMATIC S7-1500
The physical connection uses Ethernet cable, such as PROFINET cable.
A SCALANCE X 208 switch has been put in between, but is not shown, as direct
connections are possible as well.
In the above shown schematic only one of the two SIMATIC controller is required.
As a CIP client typically can maintain multiple connections, both controller and
even multiple of each can be operated at the same time.
The number of connectable servers depend on the technical data of the CIP client.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 5
2 Introduction
to access the attributes of that object. Each attribute has a certain meaning, which
is either predefined or vendor specific
The “LCCF_CIPServer” function block implements the PCCC object and a few of
its services.
schema. Variables are collected in so called files of common data type. This
means, that variables of the same data type are stored in a file of that data type.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 6
2 Introduction
The configuration for both scenarios, reading process values and writing values to
tags inside the PLC will be explained.
The server maintains one TCP connection from a single client. On the upper layers
of communication (7-Layer model ISO- OSI) the server block can handle of to 16
sessions. This number may not be obtainable on all CPU models.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 7
3 Commissioning
3 Commissioning
3.1 Preparation
As preparation for the application example to work the above-mentioned hardware
components should be placed into a rack or on a solid table to prevent slip or fall.
Further download the TIA Portal project from the SIOS entry or download the latest
version of the LCCF (Library of Competitor Conversion Functions). Store the
downloaded file onto your local computer for later use.
Establish a connection between the SIMATIC controller and either the SCALANCE
X208 switch or directly the SIMATIC Panel.
L+ M L+ M L+ M
SIMATIC
SCALANCE X208 SIMATIC Panel
Controller
PN PN PN PN PN PN PN PN PN PN PN PN
L+ M L+ M
SIMATIC PC
Controller (TIA Portal)
PN PN PN PN
PROFINET / IE
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 8
4 Configuration/Engineering
4 Configuration/Engineering
4.1 Creating and managing projects
In this application example the used TIA Portal project should have been
downloaded and stored on your local computer.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 9
4 Configuration/Engineering
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 10
4 Configuration/Engineering
Until now the server doesn’t have a mapping of process values to tags, which are
provided to CIP clients, although it is already operable.
In its next chapter this document describes how the mapping is created.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 11
4 Configuration/Engineering
The LCCF_CIPServer block implements the PCCC object only partially. This object
allows the addressing of certain memory areas within specific PLC families. The
following table explains the different addressable memory areas and their
organization.
like:
SIMATIC Q10.3
Input I I1:2/5 allows access to Boolean
like Process values (discrete channels)
Image of accessing: but is organized in WORD
Inputs
Input file 1
Word 2
Bit 5
like:
SIMATIC I4.5
Boolean B B3:0/14 allows access to Boolean
values organized in WORD
accessing:
Boolean file 3
Word 0
Bit 14
like:
SIMATIC M1.6
Timer T T4:7 allows access to Timers. A
timer has a size of 3
accessing: WORDs.
Timer file 4 • ControlWord
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 12
4 Configuration/Engineering
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 13
4 Configuration/Engineering
Figure 4-1: PCCC file type defining User Defined Data types
© Siemens AG 2021 All rights reserved
There may be not only one, but multiple files of a specific type in the mapping. The
size of each “file” although is fixed and predefined.
To create the mapping follow the instructions in the next table.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 14
4 Configuration/Engineering
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 15
4 Configuration/Engineering
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 16
4 Configuration/Engineering
NOTE You may also assign an array of files to the appropriate formal parameters, if you
have multiple of them, as shown for F-files below
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 17
4 Configuration/Engineering
The maximum size of an array of files is limited by the memory available in the
used CPU module only. The LCCF_CIPServer block itself, doesn’t apply a
limitation here.
NOTE As the files data types always define a fixed size array for a file, it is
recommended to fill them up as much as possible before creating a new file.
This saves memory in the controller.
NOTICE The controller may go into stop mode, when you change the limits in the
file type definitions
The controller may go into STOP mode seizing process control when you
change the limits of the file type definitions. It may also occur, that the CIP server
block needs to be recompiled. As the block remains protected, only the person
who knows the password can unprotect and compile the block.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 18
4 Configuration/Engineering
NOTICE Data exchange may not take place with ambiguous file numbers
The CIP server block searches for the file number starting with the first file
element in the array. Each element within the file is identified by its index.
In the above parameterization the file with index 1 is hidden by the file with
index 0. The elements “multipleFiles[1].elements[x]” are not accessible as they
have the same fileNumber as the previous defined “multipleFiles[0].elements[x]”.
To avoid this hiding of data, make sure the file numbers are unambiguous as
© Siemens AG 2021 All rights reserved
shown below.
Once the block is properly configured, the program is compiled and downloaded to
the controller, the CIP client needs to be configured before it can access the
mapped data.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 19
4 Configuration/Engineering
From the Mappings DB in this example the SIMATIC panel will access the following
© Siemens AG 2021 All rights reserved
addresses:
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 20
4 Configuration/Engineering
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 21
4 Configuration/Engineering
5 Create new tags inside the newly created If you followed the previous
folder. instructions, you have
created an HMI tag, which
accesses the PLC tag
“Mapping”.setPoints.element
s[0] inside our S7-1200
controller using CIP.
© Siemens AG 2021 All rights reserved
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 22
4 Configuration/Engineering
As you have seen, there is no S7 connection from the Panel to the PLC. This
means it uses the EtherNet/IP based communication reading the variables in the
PLC or writing to them.
NOTE WinCC Runtime Advanced has a simulation mode built in, which can be started
directly from within the TIA Portal.
This way for testing purposes you won’t need the real panel.
To start the simulation, click on the Simulation icon in the symbol menu bar.
© Siemens AG 2021 All rights reserved
This will establish the connection to the configured communication partner. In the
case of this application example, it will be either of the SIMATIC S7 controller.
NOTE The above shown example screen uses the HMI Template Suite. Parts of the
used templates are contained in the example project.
The complete HMI Template suite can be downloaded from SIOS
(ID: 91174767):
https://support.industry.siemens.com/cs/ww/en/view/91174767
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 23
5 Operating
5 Operating
5.1 Start the application
Once the PLC program is loaded into the PLC, put the CPU module into RUN
mode. This can be achieved by clicking on the “Start CPU” entry in the symbol
menu.
Figure 5-1: TIA Portal Symbol menu
Alternatively, you may use the “RUN-STOP” switch at the S7-1500 CPU.
The LCCF_CIPServer block is now executed and in IDLE mode. It does not
communicate with any partner. For this to happen the CIP server needs to be
enabled.
Best way to do that is to open the provided watch table “watch CIP Server”.
You may also create a new watch table and insert the variables according to your
configuration. The Instance of the LCCF_CIPServer block has an enable input,
which needs to turn to TRUE.
Figure 5-3: watch table – enable CIP server block.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 24
5 Operating
Verify that the modifications are transferred to the WinCC Runtime Advanced
Simulation or the Panel you have used. This communication represents the
“reading” of tags from the PLC.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 25
5 Operating
You may also modify values in the running Simulation or the real SIMATIC Comfort
Panel.
Figure 5-5: WinCC RT Advanced Simulation
Verify that the changes you made are visible in the watch table, as this represents
the “writing” direction of the communication.
© Siemens AG 2021 All rights reserved
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 26
5 Operating
5.2 Troubleshooting
In case the result is not as expected the cause could be found on both sides of the
communication path.
Before you try to change any of the program or configuration, check the physical
installation first.
Correct wiring
• Power the Power Supply up
SIMATIC doesn’t have • Check network cable to be
network connection inserted properly into the
network socket (P1.X1 or
P1.X2)
• Check and correct network
settings of your PC
SIMATIC Comfort Panel Comfort Panel is not • Check and correct the power
is not reachable from TIA powered up supply to Comfort Panel
Portal
Comfort Panel doesn’t • Check and correct the power
have network connection supply to the network switch
• Check network cable to be
inserted properly into the
network socket.
• Check and correct network
settings of your PC.
SIMATIC cannot Network switch is not • Check and correct power
communicate with powered up supply to the network switch.
SIMATIC Comfort Panel
If you checked everything and there is no communication at all, then perform the
checks recommended in the next chapter.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 27
5 Operating
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 28
5 Operating
As next measure you can take to make the configuration workable is to check the
configuration made.
Check the connection in the Comfort Panel to address the correct SIMATIC S7.
If you have set up multiple connections the configured tags may use another, then
misconfigured, connection. Check for the tags to be assigned to the correct
connection.
If this is all corrected and downloaded to the Comfort Panel, you may want to
check the LCCF_CIPServer block as well.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 29
5 Operating
Answering the following questions may give you a hint on what needs to be
corrected.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 30
6 LCCF_CIPServer block
6 LCCF_CIPServer block
6.1 Parameters
The LCCF_CIPServer block has been designed to require a minimum of
parameters to make its use as easy as possible. Still a minimum external
configuration is necessary, which is explained in the following chapter.
A call to the “CIP Server” block requires an instance DB to store operation relevant
data internally as shown in the below figure.
The instance DB is generated automatically be the TIA Portal, when the call to the
block is placed.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 31
6 LCCF_CIPServer block
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 32
6 LCCF_CIPServer block
The LCCF_CIPServer block reports a status information to the user, which follows
a standardized pattern.
The status code is split into the error flag and a status information value.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 33
6 LCCF_CIPServer block
data type
“LCCF_typeFielTypeN”
FALSE FALSE TRUE 16#8213 Error: F-File has The parameter fFile has an
an invalid type element or an array of
elements of an invalid type
assigned to it. The type
needs to be of the supplied
data type
“LCCF_typeFielTypeF”
FALSE FALSE TRUE 16#8214 Error: L-File has The parameter lFile has an
an invalid type element or an array of
elements of an invalid type
assigned to it. The type
needs to be of the supplied
data type
“LCCF_typeFielTypeL”
FALSE FALSE TRUE 16#8215 Error: ST-File has The parameter stFile has
an invalid type an element or an array of
elements of an invalid type
assigned to it. The type
needs to be of the supplied
data type
“LCCF_typeFielTypeST”
FALSE FALSE TRUE 16#8216 Error: C-File has The parameter cFile has an
an invalid type element or an array of
elements of an invalid type
assigned to it. The type
needs to be of the supplied
data type
“LCCF_typeFielTypeC”
FALSE FALSE TRUE 16#8217 Error: T-File has The parameter tFile has an
an invalid type element or an array of
elements of an invalid type
assigned to it. The type
needs to be of the supplied
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 34
6 LCCF_CIPServer block
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 35
6 LCCF_CIPServer block
For better planning of the automation program the user must be aware, that
operating the LCCF_CIPServer has certain impacts on the PLC load.
As all the protocol handling is done in a user program, the cycle time will be
extended by the time the selected CPU model needs to answer the placed request.
As one could imagine the more often data are requested, the more often these
requests need to be answered.
Setting the update rates to the lowest acceptable value will reduce the load on the
automation program.
Besides program execution time memory considerations should also be made,
when selecting a CPU model.
For the S7-1200 controller family the technical data are listed in the below table
Table 6-5: Memory Consumption S7-1200
Block Load Memory Work Memory
LCCF_CIPServer 527.249 Bytes 45.236 Bytes
Instance DB 10.379 Bytes 2.132 Bytes
The execution time of the block is CPU model dependent and was measured on a
SIMATIC S7-1215C to be less than 1ms in average.
© Siemens AG 2021 All rights reserved
In the S7-1500 controller family the two required blocks require the memory listed
in the below table
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 36
7 Appendix
7 Appendix
7.1 CIP/ PCCC Communication path settings
The CIP uses a method of encapsulating the messages adding communication
path segments to the command segment. This leads to a longer and longer
growing message as the number of routing stations grows.
As an example, the following simple layout is used to explain that fact. Here the
S7-1500 is acting as a CIP Client instead the WinCC Adv. RT used throughout the
application example. The CIP server is represented by a ControlLogix or
CompactLogix system.
ControlLogix CompactLogix
(w. external Ethernet Interface) (integrated Ethernet Interface)
Backplane vBackplane
X1 X1 X1 X1 X1
© Siemens AG 2021 All rights reserved
X2 X2 X2 X2
C ontrolN et
22 32
192.168.0.22 192.168.0.32
Ethernet
192.168.0.12
Each CIP message contains the routing information to the target. Every time a
bridge accepts such a CIP message it strips out its own address information and
forwards the modified CIP message to the next addressee along the way. When
there is no further routing information available the destination target has been
reached and the CIP message will be interpreted. Once interpreted the response
will be send the same way back the request came. This means each bridge keeps
a reference to the request package.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 37
7 Appendix
In this case a ControlLogix uses the ENET bridge in slot 4 (0 based counting) for
communicating with the CIP client. The processor module itself is in slot 1. An
additional ControlNet Bridge is in slot 6 and is not used in this scenario.
The S7-1500 sends a request to the ControlLogix on 192.168.0.22, slot 1.
ControlLogix
(w. external Ethernet Interface)
Backplane
X1 X1 X1
© Siemens AG 2021 All rights reserved
X2 X2
22
ControlNet
192.168.0.22 X2
X2
Ethernet
Therefore, the parameters in the WinCC Panel’s driver configuration needs to be:
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 38
7 Appendix
Contrary to the above described situation, the communication path here shows that
the processor module is in slot 5. Here the CIP message follows the same path as
above, only difference is the slot number.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 39
7 Appendix
7.1.2 Case 2 – Accessing the Allen- Bradley PLC via integrated Ethernet
port
In this scenario the CIP client wants to put some data into the CPU module using
the integrated Ethernet port. In a CPU module with integrated Ethernet port the
Ethernet port is in the same slot as the CPU module.
The CIP client (here the S7-1500) sends a request package to the CPU module at
192.168.0.32 addressing the processor module in slot 0.
vBackplane
X1 X1
© Siemens AG 2021 All rights reserved
X2 X2
32
192.168.0.32
X2
X2 ControlNet
Ethernet
Following the previous schema, the communication path would look like this
“192.168.0.32, 1, 0”
Following the previous made explanations the CIP message would first travel
through the processor module to the backplane to be bounced back to the
processor module for interpretation. For such situations it is possible to use an
abbreviated communication path only containing the IPv4 address.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 40
7 Appendix
7.1.3 Case 3 – Accessing the Allen- Bradley PLC via the ControlNet
interface
In this scenario the CIP client (here S7-1500) wants to read data from the Allen-
Bradley PLC. Now the communication path will be through the CompactLogix
acting as bridge between EtherNet/IP and ControlNet.
Figure 7-5: Access Path with CompactLogix as bridge
ControlLogix CompactLogix
(w. external Ethernet Interface) (integrated Ethernet Interface)
Backplane vBackplane
X1 X1 X1 X1 X1
X2 X2 X2 X2
ControlNet
22 32
192.168.0.22 192.168.0.32
Ethernet
© Siemens AG 2021 All rights reserved
192.168.0.12
The yellow line in the above picture is represented by the following communication
path.
“192.168.0.32, 1, 6, 2, 22, 1, 1”
In the communication path the red marked sections always contain a network
specific address. The blue marked part identifies the backplane or the interface to
be used. Here it doesn’t matter, whether this backplane is physically existing or
virtual. The green part identifies the slot number of the next bridge module (next
hop) or the destination module.
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 41
7 Appendix
Technical Support
The Technical Support of Siemens Industry provides you fast and competent
support regarding all technical queries with numerous tailor-made offers
– ranging from basic support to individual support contracts. Please send queries
to Technical Support via Web form:
www.siemens.com/industry/supportrequest
We support you with our globally available training courses for industry with
practical experience, innovative learning methods and a concept that’s tailored to
the customer’s specific needs.
For more information on our offered trainings and courses, as well as their
locations and dates, refer to our web page:
www.siemens.com/sitrain
Service offer
Our range of services includes the following:
• Plant data services
• Spare parts services
• Repair services
• On-site and maintenance services
• Retrofitting and modernization services
• Service programs and contracts
You can find detailed information on our range of services in the service catalogue
web page:
support.industry.siemens.com/cs/sc
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 42
7 Appendix
The Siemens Industry Mall is the platform on which the entire siemens Industry
product portfolio is accessible. From the selection of products to the order and the
delivery tracking, the Industry Mall enables the complete purchasing processing –
directly and independently of time and location:
mall.industry.siemens.com
CIP server
Entry-ID: 109782316, V1.0.0, 04/2021 43