Use of A CM PTP
Use of A CM PTP
module with a
SIMATIC ET 200SP HA
station
Siemens
CPU S7 400, ET 200SP HA CM PtP Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/109814871 Support
Legal information
Legal information
Use of application examples
Application examples illustrate the solution of automation tasks through an interaction of several components in
the form of text, graphics and/or software modules. The application examples are a free service by Siemens AG
and/or a subsidiary of Siemens AG ("Siemens"). They are non-binding and make no claim to completeness or
functionality regarding configuration and equipment. The application examples merely offer help with typical
tasks; they do not constitute customer-specific solutions. You yourself are responsible for the proper and safe
operation of the products in accordance with applicable regulations and must also check the function of the
respective application example and customize it for your system.
Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have the application
examples used by technically trained personnel. Any change to the application examples is your responsibility.
Sharing the application examples with third parties or copying the application examples or excerpts thereof is
permitted only in combination with your own products. The application examples are not required to undergo the
customary tests and quality inspections of a chargeable product; they may have functional and performance
defects as well as errors. It is your responsibility to use them in such a manner that any malfunctions that may
occur do not result in property damage or injury to persons.
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 against existing or future claims of third parties in this connection
© Siemens AG 2022 All rights reserved
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.
In order 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 under
https://www.siemens.com/cert.
Table of contents
Legal information .............................................................................................................................. 2
1 Task .......................................................................................................................................... 4
2 Solution .................................................................................................................................... 5
3 Information on Modbus RTU and the CM PtP module ........................................................ 6
3.1 Modbus RTU principle of operation ........................................................................... 6
3.2 Supported serial standards - CM PtP module ........................................................... 7
4 Implementation........................................................................................................................ 9
4.1 Hardware and software components used ................................................................ 9
4.2 Hardware setup .......................................................................................................10
4.3 Hardware configuration ...........................................................................................12
4.4 CFC engineering......................................................................................................15
4.4.1 Function blocks used ...............................................................................................15
4.4.2 CFC instructions ......................................................................................................21
4.4.3 Commissioning ........................................................................................................30
4.5 Troubleshooting .......................................................................................................34
5 Restrictions ...........................................................................................................................35
© Siemens AG 2022 All rights reserved
6 Appendix ................................................................................................................................36
6.1 Service and support .................................................................................................36
6.2 Industry Mall ............................................................................................................37
6.3 Links and literature ..................................................................................................37
6.4 Change documentation ...........................................................................................37
1 Task
Introduction
In the process industry there are often couplings between third-party devices or systems. This is
implemented in some cases with the Modbus Remote Terminal Unit (RTU) through the use of
the serial standards RS232, RS422 or RS485. In the past, the SIMATIC ET 200M was used for
this in combination with a CP341 and a separate library. The recommended solution for the
process industry today is a SIMATIC ET 200SP HA station with a CM PtP.
2 Solution
This application example demonstrates handling of a CM PtP (Point To Point) module of the ET
200SP model series in conjunction with an ET 200SP HA station.
This application example explains the use of the SIMATIC ET 200SP CM PtP module
(Communication Module Point to Point) with a SIMATIC ET 200SP HA for Modbus RTU
(Remote Terminal Unit) communication. In the process, we will address one particularity when
using ET 200SP modules with an
ET 200SP HA, present the supported protocols with wiring examples, explain the configuration
in PCS 7 and demonstrate module-specific features.
Master-slave relationship
Modbus RTU uses a master-slave relationship in which all entire communication flows from a
sole master device, while the slaves can only respond to the request by the master. The master
© Siemens AG 2022 All rights reserved
sends a request to the slave address and only the slave with this slave address answers the
request.
Special case: When using the Modbus slave address "0", the CM PtP sends a broadcast
telegram to all slaves (without receiving a slave response).
References
Master-slave communication via a CM PtP using the Modbus RTU protocol:
Readme
https://support.industry.siemens.com/cs/ww/en/view/68202723
Explanation of terms
Terms from the table above will be explained in the following. Further details can be found in the
manual (link).
References
Manual: CM PtP - Configurations for Point-to-Point Coupling
© Siemens AG 2022 All rights reserved
Readme
https://support.industry.siemens.com/cs/ww/en/view/59057093
Register
Int values
Coil
Bool values
RS232 mode
In RS232 mode, data are transmitted via at least two wires. There is one line each for the send
direction and the receive direction. It is possible to send and receive simultaneously (full
duplex).
RS422 mode
In RS422 mode, the data are transmitted via two pairs of wires (four-wire mode). There is one
line pair each for the send direction and the receive direction. It is possible to send and receive
simultaneously (full duplex). Every communication partner must be able to operate a send and a
receive facility simultaneously. Data can be exchanged between two or more communication
partners at the same time. With RS422 multipoint mode, only one slave may transmit at a time.
RS485 mode
In RS485 mode, the data is transmitted via a pair of wires (two-wire operation). The cable pair is
alternately available for the transmission direction and the reception direction. It can either be
sent or received (half duplex). After a send process, the system immediately switches to receive
mode (ready to receive). Once a new send request is received, it switches back to Send.
Half-duplex mode
Data are exchanged between the communication partners in both directions in alternation. Half-
duplex operation means that one communication partner is transmitting at one time and the
other communication partner is receiving. In this case, a wire is used alternately for sending and
receiving.
Multipoint slave
© Siemens AG 2022 All rights reserved
Multipoint master
The communication module can be used as a multipoint master.
4 Implementation
PCS 7 enables configuration of Modbus RTU communication for the CM PtP module of the ET
200SP in conjunction with the ET 200SP HA by means of channel blocks in the CFC chart. This
chapter will show you which settings should be adjusted for this in the hardware configuration, in
CFC engineering and during commissioning.
To this end, a CM PtP module will be configured as master (for recording third-party data) and a
CM PtP module as slave (for provision of data from a third-party system). The communication
partner in each case in production operations is a Modbus sensor in the slave role or a third-
party station as either the master or slave, for example, which use the Modbus RTU.
Hardware components
Table 4-1 Hardware components used
Component Qty. Item number Note
IM 155-6 PN 1 6DL1155-6AU00-0PM0 FW V1.2
BA 2xRJ45 1 6DL1193-6AR00-0AA0
Carrier module (Single) 1 6DL1193-6BH00-0SM0
© Siemens AG 2022 All rights reserved
If you use other hardware than that used in the example project, such as a redundant setup,
Note you must make the corresponding changes in the hardware configuration. In this case, note
the modules approved for use with PCS 7.
References
FAQ: Which additional modules can be used on the SIMATIC
ET 200SP HA and what do you have to watch out for in the slotting sequence?
Readme https://support.industry.siemens.com/cs/ww/en/view/109811985
Wiring
The Base Unit of the CM PtP module is wired differently depending on the desired protocol type,
as shown in the tables below.
RS 485
Table 4-3 RS 485 wiring
CM Master CM Slave
© Siemens AG 2022 All rights reserved
RS 422
Table 4-4 RS 422 wiring
CM Master CM Slave
Description Pin Pin Description
T(A)- 11 12 R(A)-
R(A)- 12 11 T(A)-
T(B)+ 13 14 R(B)+
R(B)+ 14 13 T(B)+
GND 15 15 GND
GND 16 16 GND
RS 232
Here, at least the pins for RXD, TXD and GND must be used.
Table 4-5 RS 232 wiring
CM Master CM Slave
Description Pin Pin Description
RXD 2 1 TXD
TXD 1 2 RXD
RTS 3 4 CTS
CTS 4 3 RTS
CSR/DSR 6 5 DTR
DTR 5 6 CSR/DSR
GND 10 9 GND
GND 9 10 GND
References
CM PtP interface names:
Readme
https://support.industry.siemens.com/cs/ww/en/view/59057093
© Siemens AG 2022 All rights reserved
Note The configured version of the ET 200SP HA must be at least version 1.2.
The CM PtP module is dragged onto the slot corresponding to the wiring.
Right-clicking on the added module, then clicking on the "Object properties..." option opens the
module settings menu. In the "Parameters" section, you can change typical settings for
modules, such as the type of the potential module. Specific parameters for the CM PtP module
such as the protocol or mode can be adjusted in the "Connection configuration" tab. With this
module, the settings in the "Connection configuration" tab and "Connection parameters" tab will
be overwritten by the channel blocks in the CFC chart, configured later. However, it is
recommended to set these parameters to be identical to the ones in the CFC charts.
This prevents a malfunction of the CM PtP modules and an interruption of communication
during H-CiR download, which among other things is required when adding another hardware
module to the SIMATIC ET 200SP HA.
Parameter settings of the CM PtP, which can be made both in the hardware configuration as
Note well as in the CFC chart, should be identical in order to better ensure reliable communication
after carrying out the H-CiR functionality.
For later CFC engineering, a symbol must be created for the first input byte of a CM PtP: Select
module → right-click on "E address" → "Edit symbols...".
Under "Symbol", assign the first input byte (EB) of the module an appropriate name and confirm
your entry → "Apply" → "Close".
Afterwards, the hardware configuration is compiled by clicking "Save and compile" (1), then
downloaded to the CPU with "Download target system" (2).
Channel blocks
The program blocks required for communication are located in the PCS 7 AP Library V9.1 →
Block+Templates\ → Comm.
The function blocks call the following system functions in the background:
Channel block FB number
Send_Config FB1991
Receive_Config FB1992
Send_P2P FB1993
Receive_P2P FB1994
Receive_Reset FB1995
Modbus_Comm_ FB1996
Load
Modbus_Master FB1997
Modbus_Slave FB1998
Diagnostic block
For each configured CM PtP module, a diagnostic block is created and interconnected in the
@charts during compilation of the CFC charts with driver generator.
The block issues messages about failures, wire breaks, power supply faults, incorrectly inserted
modules or timeout.
MBComm
MBComm represents the basis for connecting additional channel blocks. One such block must
be created for every CM PtP module. A maximum of ten channel blocks may be connected to
© Siemens AG 2022 All rights reserved
MBComm.
Table 4-8 MBComm parameters
RESP_TO USInt IN Time interval during which the master waits for an
answer. The valid range is 5 to 65535 ms.
References
Table taken from chapter 3.2.2 and adapted for the CM PtP module:
Readme
https://support.industry.siemens.com/cs/ww/en/view/69124220
MBPdReg
With the "Modbus Provide Registers" block, the slave provides register values (Int) for a master.
MBWrCoil
The master writes coil values (Bool) to a slave with the "Modbus Write Coil" block.
© Siemens AG 2022 All rights reserved
MBRdCoil
The master reads coil values (Bool) from a slave with the "Modbus Read Coil" block.
Table 4-12 MBRdCoil parameters
MBWrReg
The master writes register values (Int) to a slave with the "Modbus Write Registers" block.
Table 4-13 MBWrReg parameters
MBRdReg
The master reads register values (Int) from a slave with the "Modbus Read Registers" block.
Table 4-14 MBRdReg parameters
This chapter explains all the steps to commission the CM PtP, either as master or as slave. This
application example uses the serial standard RS 232. Only the settings required for
commissioning will be addressed in this chapter.
Optional changes will be mentioned or can be found in the previous
chapter 4.4.1.
The CFC charts for Modbus communication must be created or extended in the Plant View in
the hierarchy folder of the CPU that is connected with the ET 200SP HA.
MBComm
An "MBComm" channel block must be created for each CM PtP module. The channel blocks
can be found under "Libraries". You can search for them with the navigation or by entering the
function block number or name. A function block is added to the CFC by dragging and dropping.
The input "CM_Start" must be linked with the first input byte of the CM PtP module. To do this, a
symbol is created in the hardware configuration for the corresponding address (see 4.3
Hardware configuration), then the address is linked in the CFC chart:
Right-click on "CM_Start" → "Text interconnect..." → select desired symbol.
Here you should make the following settings and confirm with "OK".
• Scope → "Entire program"
• Generate module drivers → "checked"
The "Configure" parameter is needed later during commissioning to set the Modbus
communication settings (with an edge).
The other input parameters must be adapted to suit the communication partner. In this
Note application example, the communication partner has the same parameters as the default
input parameters of MBComm.
The other desired channel blocks are used on MBComm and are connected with the associated
input parameter "ConIn" via the output parameter "ConOut" of "MBComm" Here, remember to
always use MBComm in the same cyclic organization block as all the connected blocks.
The "MBRdCoil" block is configured in this example to read the coils of a slave:
Add "MBRdCoil" block → click on "ConOut" output parameter of MBComm → click on "ConIn"
input parameter of "MBRdCoil".
Coils (Bool variables) are written from the master to a slave with the "MBWrCoil" block. Here,
like with "MBRdCoil", the three parameters described above are likewise required and
complement the values to be written:
• ModbAddr (Int; Modbus slave address of the partner) → "2"
• DataAdr (DInt; start of the desired memory range 1-9999 to which you wish to write) → "1"
• Num (Int; number of coils that you wish to send 1-8) → "8"
• PV_In_[1-8] (Bool; input values that must be written to the slave)
The blocks "MBRdReg" and "MBWrReg" are structured like "MBRdCoil" and "MBWrCoil".
Here, however, the PV variables are Int values and the parameter DataAdr has a different
memory range:
• DataAdr MBRdReg (DInt; start of the desired memory range 40001-49999) → "40009"
• DataAdr MBWrReg (DInt; start of the desired memory range 30001-49999) → "40001"
If the CM PtP module is acting as a slave, a "MBComm" block still has to be created and the
parameter inputs must be interconnected with the same settings (identical Baud rate, etc.) as
with a master. Here you must not forget to run the block in slave mode:
• IsMaster (Bool; setting of CM PtP module as master or slave) → "0" for slave
Note If the CM PtP module is used as a slave, then no coils can be written or read, only registers.
The MBPdReg block is required for provision of data to the master by the slave. After this, the
following parameters must be modified:
• ModbAdr (Int; Modbus slave address of the partner) → "2"
• DataAddr → (DInt; start of the desire memory range with start addresses 40001 - 40073
from which you wish to read) → "40009"
• PV_In_[1-8] (STRUCT of 1 Int (value) and 1 byte (signal status), input values provided by
the slave)
The following start addresses for DataAddr are typical when using Integers (8 bytes): 40001,
Note
40009, 40017, 40025, 40033, 40041, 40049, 40057, 40065, 40073
MBRcvReg for receiving data provided by the master is configured like MBPdReg, but in this
case the process values are output:
• ModbAdr (Int; Modbus slave address of the partner) → "2"
• DataAddr → (DInt; start of the desired memory range with start addresses 40001 - 40073
to which you wish to write → "40009"
• PV_Out_[1-8] (STRUCT of 1 Int (value) and 1 byte (signal status), output values that the
master previously wrote to the slave)
Once all desired CFC objects have been created, the program must be recompiled and then
downloaded to the CPU. This completes the preliminary configurations for commissioning.
Final note
The PV parameters can be interconnected with additional blocks or tags in data blocks. When
doing so, pay attention to the structure of the outputs, since in this case for each PV output, a
status value is also transmitted alongside with coil/register value.
Figure 4-18 Data block structure, register and coil input & output values
© Siemens AG 2022 All rights reserved
To avoid overcomplication, the PV parameters of the blocks have not been interconnected
Note
with data blocks or other data block types in this application example.
4.4.3 Commissioning
After successful compilation of the CFC charts, the program is downloaded to the CPU. Next,
the CFC charts and the values pending at the parameters can be monitored:
1. Press the "Test mode (on/off)" switch.
2. Right-click on block "Watch On".
3. "Ctrl + left-click" keyboard combination on respective parameter you wish to monitor.
Communication is initialized with a rising edge at the input parameter "Configure" of the
respective "MBComm" block.
Figure 4-21
After this, the following values should be present at the output parameters on "MBComm":
TagCount (Int; number of blocks connected with MBComm)
ConfInit (Bool; 1 if initialization successful) → "1"
Use of a CM PtP module with SIMATIC ET 200SP HA
Article ID: 109814871, V1.0, 11/2022 30
4 Implementation
There is also an additional parameter for read/receive blocks, but because it appears in the
CFC with a delay it is not suitable to Watch, although it can be interconnected with program
logic.
• NewData (Bool; value 1 if new data were received in this cycle)
This completes commissioning. If the status deviates from the expected value and no data
exchange is taking place, chapter 4.5, "Troubleshooting" can provide assistance.
© Siemens AG 2022 All rights reserved
CFC examples
The following lists example images with Modbus communication from two
CM PtP modules.
"Figure 4-22 Coil data transfer" shows how the CM PtP master modules writes coils to a slave
and reads them from a slave, including the associated MBComm block.
Figure 4-23 Register data transfer shows how the Modbus master provides registers to the
slave and vice versa – how the Modbus slave provides registers to the Modbus master.
4.5 Troubleshooting
The table below lists state codes and error codes of the output parameter "Status" from the
channel blocks interconnected at MBComm.
Code Meaning
16#000A No new data from MBComm; communication established; status good
16#000B No new data from MBComm; time error in communication
16#000C Block is deactivated
16#000D Communication is disabled
16#000E Error on higher level; channel/module/rack error
16#000F Function block attempting to connect with MBComm
16#0010 DATA_ADDR modified, PV_Out valid if the master queries the slave
16#0020 MBComm is configured as slave and not as master, or vice versa
References
© Siemens AG 2022 All rights reserved
Chapter 4 of the manual provides verbose information about further error codes:
Readme
https://support.industry.siemens.com/cs/ww/en/view/69124220
5 Restrictions
• The technical specifications of the CM PtP module (chapter 7) must be observed. See:
https://support.industry.siemens.com/cs/ww/en/view/109793681
• What restrictions are there for active jobs when communicating with "WR_REC/"RD_REC"
and "RDREC"/"WRREC" via PROFIBUS DP and PROFINET IO? - See:
https://support.industry.siemens.com/cs/ww/en/view/15364459
• No more than ten channel blocks can be connected to the MBComm channel block or have
the parameter set to "Enabled". If this is not the case, communication will no longer work for
the eleventh block on up. Scheduling can be a workaround for this.
• Parameter settings of the CM PtP module, which can be made both in the hardware
configuration as well as in the CFC chart, should be identical in order to ensure more
reliable communication after
executing the H-CiR functionality.
© Siemens AG 2022 All rights reserved
Table 5-1 Supported write and read access operations of the CM PtP
Role Area Support
Master Coils Yes
Register Yes
Slave Coils No
Register Yes
6 Appendix
6.1 Service and support
Industry Online Support
Do you have any questions or need assistance?
Siemens Industry Online Support offers round the clock access to our entire service and support
know-how and portfolio.
The Industry Online Support is the central address for information about our products, solutions
and services.
Product information, manuals, downloads, FAQs, application examples and videos – all
information is accessible with just a few mouse clicks:
support.industry.siemens.com
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:
siemens.com/SupportRequest
© Siemens AG 2022 All rights reserved
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 catalog web page:
support.industry.siemens.com/cs/sc
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
https://support.industry.siemens.com
\2\ Link to this entry page of this application example
https://support.industry.siemens.com/cs/ww/en/view/109814871
\3\ SIMATIC Process Control System PCS 7 Released modules (V9.1 SP2)
https://support.industry.siemens.com/cs/ww/en/view/109812604
\4\ SIMATIC ET 200SP CM PtP
https://support.industry.siemens.com/cs/ww/en/view/109793681
\5\ PtP communication instructions used on distributed I/O of an S7-300/400
https://support.industry.siemens.com/cs/ww/en/view/69124220
\6\ CM PtP - Configurations for point-to-point connections
https://support.industry.siemens.com/cs/ww/en/view/59057093
\7\ Master-Slave Communication via a CM PtP using the Modbus RTU Protocol
https://support.industry.siemens.com/cs/ww/en/view/68202723