Configuring ET 200SP PtP Modbus Communication in SIMATIC PCS 7 CFC
In SIMATIC PCS 7 Continuous Function Chart (CFC), serial Modbus RTU communication using the ET 200SP CM PtP module cannot be wired using direct instance Data Block (DB) cross-connections as done in STEP 7 Ladder logic. In CFC, parameter exchange and coordination between the Port_Config instruction and Modbus_Master block must be handled by encapsulating the STEP 7 PtP library instructions inside a dedicated SCL wrapper Function Block (FB), or by utilizing the official SIMATIC PCS 7 Modbus PtP communication library. This wrapper encapsulates the internal instance data pointers, exposing clean, technological input/output pins on the CFC sheet.
Table of Contents
- Architecture of ET 200SP PtP Modbus Communication in PCS 7
- Why Direct Instance DB Cross-Connections Fail in CFC
- Software Architecture Options: SCL Wrapper vs Official PCS 7 PtP Library
- Developing an SCL Multi-Instance Wrapper Block for CFC Integration
- Hardware Configuration and Addressing in S7-400 / ET 200SP Systems
- Step-by-Step Procedure to Implement ET 200SP Modbus in CFC
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Architecture of ET 200SP PtP Modbus Communication in PCS 7
In modern SIMATIC PCS 7 architectures, the SIMATIC ET 200SP distributed I/O station connects to S7-400 automation controllers via PROFINET IO using the IM 155-6 PN HF (6ES7155-6AU01-0BN0) interface module. To integrate serial third-party field devices (such as energy meters, variable frequency drives, or gas analyzers), the ET 200SP CM PtP communication module (6ES7137-6AA00-0BA0) provides RS-232, RS-422, and RS-485 interfaces supporting Modbus RTU, Modbus ASCII, and free Freeport protocols.
In standard STEP 7 (LAD/FBD/STL), configuring the CM PtP relies on the PtP Communication Instructions Library, primarily utilizing:
1. Port_Config (FB 610): Initializes port baud rate, parity, stop bits, and flow control.
2. Modbus_Comm_Load (FB 640): Prepares the internal communication buffer and registers data structures.
3. Modbus_Master (FB 641): Executes Modbus master read/write function codes (01, 02, 03, 04, 05, 06, 15, 16) by referencing communication buffer DBs.
However, when engineers attempt to instantiate these blocks directly on a PCS 7 Continuous Function Chart (CFC), they encounter structural limitations inherent to the PCS 7 graphical engineering paradigm.
Why Direct Instance DB Cross-Connections Fail in CFC
In traditional Ladder Logic (LAD), an engineer creates an instance DB for Port_Config and directly reads or writes its internal static variables (e.g., DB100.DBX12.0) to transfer configuration confirmation to Modbus_Master.
In SIMATIC PCS 7 CFC, this programming model is strictly prohibited by design:
* Encapsulation & Type Safety: CFC prohibits ad-hoc pointer wiring to arbitrary memory addresses within another block's instance data block. Every interconnection must occur between strictly typed block I/O pins (e.g., BOOL, INT, WORD, REAL, or defined STRUCT).
* Dynamic DB Assignment by CFC Compiler: In PCS 7, engineers never manually assign instance DB numbers. During compilation, the CFC compiler dynamically assigns instance DB numbers from a reserved pool (typically DB 1 to DB 60). Hardcoding DB numbers or passing raw DB addresses disrupts the compiler's runtime map and can cause memory collisions during delta compiles.
* Internal Complex Data Types: The communication parameter structure (PORT, COND_DATA, BUFFER) required by Siemens PtP blocks uses complex internal data structures that cannot be broken out into simple CFC chart connection lines.
Software Architecture Options: SCL Wrapper vs Official PCS 7 PtP Library
To successfully integrate the ET 200SP CM PtP in a PCS 7 project, engineers must select one of two validated engineering approaches:
- Dedicated SCL Wrapper Function Block (Recommended for Custom Projects):
The engineer writes an S7-SCL Function Block (e.g.,FB_PtP_Modbus_Master) that declaresModbus_Comm_LoadandModbus_Masteras multi-instances within its internalSTATICvariable area. The SCL code internally handles the handshakes, buffer pointers, and state machine transitions. The wrapper block exposes only technological pins in CFC (e.g.,StartScan,SlaveAddress,RegisterOffset,DataOut,Error,Status). - SIMATIC PCS 7 Modbus PtP Communication Library:
Siemens provides specialized add-on libraries for PCS 7 serial communication. These libraries supply pre-engineered CFC blocks that comply with the PCS 7 driver concept, providing automated diagnostic reporting, maintenance alarms, and standard WinCC faceplate integration.
Developing an SCL Multi-Instance Wrapper Block for CFC Integration
An SCL multi-instance wrapper cleanly encapsulates communication complexities. The internal structure operates as follows:
FUNCTION_BLOCK "FB_PCS7_Modbus_Master"
TITLE = 'ET200SP CM PtP Modbus Master Wrapper'
{ S7_m_c := 'true'; S7_tasklist := 'OB100,OB35' }
VERSION : '1.0'
VAR_INPUT
HW_ID : WORD := 16#0100; // Hardware identifier from HW Config
BaudRate : DINT := 9600;
Parity : INT := 1; // 1=None, 2=Even, 3=Odd
SlaveAddr : INT := 1;
ModbusMode : INT := 0; // 0=Read, 1=Write
DataAddr : UDINT := 40001; // Holding register starting address
DataLen : UINT := 10;
Execute : BOOL := FALSE;
END_VAR
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Error : BOOL;
Status : WORD;
ReadData : ARRAY[1..10] OF WORD;
END_VAR
VAR
inst_CommLoad : "Modbus_Comm_Load";
inst_Master : "Modbus_Master";
stat_Buffer : ARRAY[1..128] OF BYTE;
stat_InitDone : BOOL := FALSE;
END_VAR
BEGIN
// Internal initialization and cyclic execution logic
// Inst_CommLoad and Inst_Master execute within the unified instance DB
END_FUNCTION_BLOCK
By compiling this SCL source, SIMATIC Manager generates a clean, single Function Block (FB_PCS7_Modbus_Master). When placed into a CFC chart, the CFC compiler assigns a single instance DB, and all internal buffers remain completely protected.
Hardware Configuration and Addressing in S7-400 / ET 200SP Systems
The following table summarizes the hardware configuration parameters and address mapping required for ET 200SP PtP integration in PCS 7:
IM 155-6 PN HF (6ES7155-6AU01-0BN0)CM PtP (6ES7137-6AA00-0BA0)BU Type A0 (Dark BaseUnit)LADDR / HW_ID256)SFB 52 (RDREC) / SFB 53 (WRREC)Step-by-Step Procedure to Implement ET 200SP Modbus in CFC
To configure and execute ET 200SP CM PtP Modbus communication in PCS 7 CFC:
- Configure Hardware in HW Config:
* Open the PROFINET line on the S7-400 CPU and insert theIM 155-6 PN HFstation.
* Add theCM PtPmodule (6ES7137-6AA00-0BA0) into Slot 2 of the ET 200SP rack.
* Open the CM PtP object properties, select the protocol Modbus RTU, and note the logical I/O base address (LADDR, e.g.,W#16#0100).
* Save and compile the hardware configuration. - Import or Author the SCL Wrapper Block:
* In SIMATIC Manager, navigate to the S7 Program > Sources folder and create an SCL source file containing the multi-instance wrapper block.
* Compile the SCL source. The generated FB appears in the Blocks offline container. - Instantiate the Block in CFC:
* Open the desired CFC chart in the Plant Hierarchy.
* Drag the wrapper block from the Block Catalog into the chart.
* Connect the module base address (LADDR) to the block'sHW_IDinput. - Configure Cyclic Execution in CFC Run Sequence:
* Open the Run Sequence editor in CFC.
* Move the communication block into a cyclic interrupt organization block (typically OB35, e.g., 100 ms). Communication blocks must execute at deterministic cyclic intervals. - Compile and Download:
* Perform a CFC compilation (Generate Module Drivers enabled).
* Download changes to the S7-400 CPU in RUN-P mode.
Verification
Verify that serial communication is healthy using the following systematic steps:
1. Observe the physical status LEDs on the front of the CM PtP module:
* RUN LED: Solid green (module initialized and operational).
* Tx LED: Flashes green periodically (master transmitting poll telegrams).
* Rx LED: Flashes green immediately following Tx (slave responding).
* ERROR LED: Dark/off (no framing, parity, or timeout errors).
2. Open the CFC chart in Test Mode (Online Dynamic Display) and observe the block outputs:
* Done pulses TRUE upon successful telegram completion.
* Error remains FALSE.
* Status displays 16#0000 (success).
* ReadData registers update dynamically with real-time field measurements.
3. If Error is TRUE, inspect the Status WORD against the Modbus error table (e.g., 16#80C8 indicates a response timeout; 16#8080 indicates invalid hardware address).
Limitations and Operational Precautions
- Execution Organization Block: Never execute serial communication blocks in OB1 (free cycle) in PCS 7. Serial state machines require deterministic timing provided by cyclic interrupt OBs (OB32–OB35).
- Telegram Throughput Limits: Modbus RTU at 9600 or 19200 baud over RS-485 is half-duplex and relatively slow. Sequence multiple read commands sequentially rather than pulsing parallel requests, allowing at least 20 ms to 50 ms turnaround time per telegram.
- Controller Memory Consumption: Each SCL communication wrapper instantiates internal data buffers. Verify CPU work memory allocation in Module Information (
Ctrl+D) before adding numerous PtP channels. - Commercial Accuracy: Verify the hardware MLFBs (
6ES7137-6AA00-0BA0for CM PtP,6ES7155-6AU01-0BN0for IM 155-6 PN HF) and relevant software entitlements. Procure hardware and licenses via an authorized Siemens distributor quotation.
Engineer FAQ
Can I use the standard S7-300 CP 341 Modbus blocks (FB 7 / FB 8) for ET 200SP CM PtP?
No. The legacy CP 341 (6ES7341-1CH02-0AE0) communicates using S7-300 backplane P-bus calls (FB 7 P_RCV_RK and FB 8 P_SND_RK). The ET 200SP CM PtP operates over PROFINET using asynchronous record reading and writing via standard system function blocks (SFB 52 RDREC / SFB 53 WRREC).
Why does CFC delta compile fail if I manually assign an instance DB to a communication block?
CFC reserves a specific block of DB numbers for internal chart compilation. Manually creating a DB in that range or binding a hardcoded instance DB conflicts with the CFC compiler's symbol allocation engine, triggering fatal compilation errors.
How many Modbus slave devices can be connected to a single ET 200SP CM PtP module?
Electrically, the RS-485 transceiver supports up to 32 standard unit-load bus devices without repeaters over a maximum distance of 1200 meters. The software wrapper must poll each slave address sequentially by altering the SlaveAddr input pin upon each successful Done pulse.
Does the ET 200SP CM PtP require an external hardware dongle for Modbus RTU?
No. Unlike the legacy CP 341 which required a physical hardware dongle inserted into the back of the module for Modbus Master/Slave capability, the ET 200SP CM PtP includes Modbus RTU firmware capability natively without requiring hardware dongles.
Technical References
- SIMATIC ET 200SP Communication Module CM PtP Manual - Siemens AG
- SIMATIC S7-400 / PCS 7 System Software for S7-300/400 System and Standard Functions - Reference Manual
- SIMATIC Process Control System PCS 7 Compendium Part A - Configuration Guidelines
Related Articles
- Configuring Modbus TCP Communication in PCS 7 with Redundant S7-400H Controllers
- Integrating Serial Devices into SIMATIC PCS 7 via PROFINET Gateway
- Diagnosing Industrial Ethernet and PROFINET IO Faults on ET 200SP Distributed I/O
Related Tags
- ET 200SP
- CM PtP
- Modbus RTU
- CFC Programming
- S7-400
- PROFINET