Resolving CFC Compilation Errors When Importing Legacy CP 341 Modbus Blocks into PCS 7 V8.0
In SIMATIC PCS 7 V8.0, compilation errors occurring after importing legacy CP 341 communication blocks (RCV_341 / FB 7 and SND_341 / FB 8) from PCS 7 Library V7.1 stem from missing point-to-point system data types (UDTs), outdated block interface signatures, and block number collisions with the Advanced Process Library (APL). PCS 7 V8.0 APL does not natively include legacy CP 341 driver blocks. To resolve compilation failures, install the official 'SIMATIC S7-CP 341 Point-to-Point Communication' driver package on the Engineering Station (which installs compatible P_RCV_RK and P_SND_RK blocks along with required system data types), update block types in the Master Data Library, and assign unique FB numbers that do not conflict with the APL reserved range.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
Interfacing serial RTU field telemetry (such as Modbus RTU remote terminal units) to an S7-400 controller via a CP 341 communications processor is a widespread industrial requirement. When engineering teams on PCS 7 V8.0 attempt to implement Modbus routines by manually copying legacy blocks (RCV_341, SND_341) from old PCS 7 V7.1 installation media, CFC compilation frequently fails. The compiler reports unresolved data structures, invalid parameter assignments, or library version mismatches. Because PCS 7 V8.0 is built on the Advanced Process Library (APL) architecture, integrating legacy point-to-point blocks requires installing the correct CP 341 driver software, reconciling system UDTs, or deploying the dedicated SIMATIC PCS 7 Modbus Library.
Architecture and Fundamental Mechanics
The communication architecture between an S7-400 CPU and a CP 341 serial processor involves multi-layered software dependencies:
- The CP 341 Communication Block Hierarchy:
* The CP 341 module executes Modbus RTU protocol handling in onboard firmware via a loadable driver dongle.
* In the AS controller, communication is driven by system function blocks:P_SND_RK(FB 8) andP_RCV_RK(FB 7), which coordinate data transfers across the S7-400 K-bus backplane.
* In legacy PCS 7 V7.1, wrapper blocksSND_341andRCV_341encapsulated these calls along with specific diagnostic parameters. - Why Copying V7.1 Blocks Fails in V8.0:
* Missing System UDTs:RCV_341relies on internal User-Defined Data Types (UDTs) defining communication status and parameter structures. If only the FB is copied without importing the corresponding UDTs into the S7 Program's offline block folder, the CFC compiler throws fatal syntax errors.
* Block Number Conflicts with APL: In PCS 7 V8.0, the APL reserves extensive FB and DB number ranges (e.g., FB 1800 to FB 1999). If legacy blocks use overlapping numbers or call obsolete system functions, compilation aborts.
* Missing Engineering Drivers: The CP 341 hardware configuration and parameterization interface requires the 'CP 341: Point-to-Point Communication' software package installed on the ES. Without it, STEP 7 cannot compile parameter DBs for the serial module. - The Recommended Architecture (PCS 7 Modbus Library):
* Siemens provides the official SIMATIC PCS 7 Modbus Master / Slave Library (6ES7658-5FX...). This library provides native APL-compliant channel blocks (ModbDir,ModbC341) that integrate directly into the module driver generator and provide standard WinCC diagnostic faceplates.
Step-by-Step Implementation Procedure
Follow these procedures to resolve CP 341 block compilation errors in PCS 7 V8.0:
- Install the CP 341 Point-to-Point Engineering Package:
* On the Engineering Station, run the setup for SIMATIC S7-CP 341 Point-to-Point Communication (included on the PCS 7 Additional Products DVD or downloadable from SIOS).
* This installs the hardware parameterization tool, standard function blocks (P_SND_RK,P_RCV_RK), and required UDTs. - Import Clean Blocks and UDTs into the Master Data Library:
* Open SIMATIC Manager and navigate to the multiproject's Master Data Library.
* OpenFile > Open > Librariesand select the CP PtP library.
* Copy the required communication blocks (P_RCV_RK/ FB 7,P_SND_RK/ FB 8) and associated UDTs into the Master Data LibraryBlocksfolder.
* If using custom wrappers, verify that no FB number conflicts exist with installed APL blocks. - Execute Block Type Update Across S7 Programs:
* In the Master Data Library, select the block folder.
* SelectOptions > Charts > Update Block Types....
* Select all AS programs in the multiproject.
* Confirm the update; STEP 7 synchronizes the block signatures across all offline chart databases. - Parametrize CP 341 in HW Config:
* Open HW Config in SIMATIC Manager.
* Double-click the CP 341 module to open its properties.
* Under the Basic Parameters tab, configure the transmission protocol (e.g., Modbus RTU Master).
* Configure baud rate, parity, data bits, and stop bits to match the third-party RTU device (e.g., 9600 baud, 8 data bits, no parity, 1 stop bit).
* Save and compile HW Config. - Instantiate and Interconnect in CFC:
* In the CFC chart, insert the communication blocks.
* Interconnect the module logical base address (LADDR) matching HW Config.
* Parametrize the data block pointers (DB_NO,DBB_NO,LEN) to define the transmission buffers. - Recompile the S7 Program:
* In CFC, selectChart > Compile > Scope: Entire program.
* Verify that compilation completes with zero errors.
Verification
After compilation, download the program to the S7-400 CPU. Connect the CP 341 RS-485 / RS-232 port to the Modbus RTU device. Switch the CPU to RUN. In CFC test mode, verify that the receive block toggles its NDR (New Data Received) output bit upon every polling cycle, and that error outputs (ERROR, STATUS) report 0. Verify that process values appear correctly in the designated destination Data Block.
Limitations and Operational Precautions
Ensure that the CP 341 hardware dongle (hardware key inserted in the back of the module) is installed for Modbus Master or Modbus Slave protocols. Operating the module without the physical driver dongle causes the CP 341 SF LED to illuminate and halts serial transmission.
Engineer FAQ
Why are RCV_341 and SND_341 missing from the PCS 7 V8.0 APL library?
APL standardized on modern technological blocks and introduced the dedicated PCS 7 Modbus Library; legacy point-to-point blocks were moved to optional legacy compatibility libraries.
Can I use standard STEP 7 blocks P_SND_RK and P_RCV_RK in PCS 7 CFC?
Yes. Standard blocks P_SND_RK (FB 8) and P_RCV_RK (FB 7) can be placed directly in CFC charts provided their UDTs are present in the block folder.
What is the difference between CP 341 and CP 441 in PCS 7?
CP 341 resides on the ET 200M distributed I/O station; CP 441 resides directly in the central S7-400 controller rack.
Does the PCS 7 Modbus Library require a separate license?
Yes. The official SIMATIC PCS 7 Modbus Master / Slave Library is an add-on product requiring an engineering license and runtime licenses per controller.
Technical References
- SIMATIC S7-300 / S7-400 CP 341 Point-to-Point Communication Installation and Parameterization Manual
- SIMATIC Process Control System PCS 7 Modbus Master / Slave Function Manual
- Siemens Industry Online Support Entry 109780813 - PCS 7 Licensing and Engineering Guidelines
Related Articles
- Hardware Compatibility and Upgrade Paths - S7-400 CPUs vs CPU 410-5H in PCS 7 V9.0 SP3
- Interfacing PCS 7 V8.2 with Third-Party Automation Systems Using OpenPCS 7 and OPC UA
- Resolving CFC Error 1739 -60451 'Illegal Parameter Assignment' When Copying Charts and Templates
Related Tags
- CP 341
- Modbus RTU
- RCV_341
- SND_341
- P_RCV_RK
- CFC Compile Error