Overview
The Siemens SIMATIC S7-300 CP341 communication processor performs serial point-to-point data exchange. When Modbus RTU or Modbus ASCII traffic is required, the standard firmware on the CP341 is insufficient: an additional Loadable Driver is loaded into the module's flash memory. That driver is gated by a hardware license key — the Modbus dongle — which is physically plugged onto the CP341 module's two-pin license header. Once the dongle is present and the driver is loaded, the CP341 functions as a Modbus master or a Modbus slave on the RS-485 / RS-232 segment.
This reference consolidates the licensing model, the four ordering codes (MLFBs) for the master and slave dongles, the rules around software reuse on subsequent projects, the hardware equivalence of the two dongle variants, and the practical commissioning steps an integrator must follow when ordering and deploying a Modbus-enabled CP341.
CP341 Module Family and Modbus Loadable Driver Architecture
The CP341 is a serial communication module for the S7-300 rack. Three protocol stacks are available:
- ASCII driver — free, generic 3964(R) / ASCII framing for transparent character transmission.
- Modbus Master RTU/ASCII Loadable Driver — licensed, gates full Modbus master functionality (function codes 01, 02, 03, 04, 05, 06, 07, 08, 11, 12, 15, 16, 17, 20, 21).
- Modbus Slave RTU/ASCII Loadable Driver — licensed, gates full Modbus slave functionality (function codes 01, 02, 03, 04, 05, 06, 07, 08, 11, 12, 15, 16, 17, 20, 21).
Both loadable drivers are loaded into the CP341's flash memory through the PtP configuration tool shipped on the CD accompanying each dongle. The hardware key (dongle) is interrogated at module start-up; if the dongle is absent or matches the wrong role, the CP341 refuses to enter data exchange and the diagnostic buffer records a license violation.
Critically, the master and slave drivers are distinct licensed objects. A CP341 equipped with a master dongle cannot serve Modbus slave requests, and a CP341 equipped with a slave dongle cannot initiate master requests. The two drivers can coexist on the same project CD, but only the role matching the dongle in place will run.
License Model: Dongle + Software Delivery
Siemens distributes Modbus capability for the CP341 in two pieces:
- Software media — a CD containing the Modbus loadable driver binary, the PtP configuration tool, and electronic manuals. The CD is functionally a one-time acquisition: its contents may be archived and reused indefinitely on the same or subsequent projects.
- Hardware license key (dongle) — a small PCB module that snaps onto the two-pin license header on the CP341 front plate. The dongle is bound to a specific role (master or slave) and is required for every CP341 that runs Modbus in production.
The licensing intent is that Siemens charges once per CP341 that runs Modbus, while allowing integrators to keep one master CD and one slave CD on file for engineering use. A new project that adds a Modbus CP341 requires a new dongle of the correct role, but does not require a new CD if the existing media is still on the shelf and matches the role.
Master vs Slave Dongle Hardware Identification
Two distinct MLFB families exist. The hardware PCB inside the dongle shell is mechanically and electrically identical between master and slave roles — the role distinction is encoded in the dongle's license response, not in its connector or pinout. Mis-swapping roles causes a license error at CP341 start-up rather than a hardware fault, so a dongle ordered for the wrong role is recoverable by replacement, not by rework.
| Role | MLFB (Ordering Code) | Bundle Contents | Typical Use |
|---|---|---|---|
| Master | 6ES7870-1AA01-0YA0 | Dongle + Software CD | First CP341 in a master role; covers both the license key and the engineering media |
| Master | 6ES7870-1AA01-0YA1 | Dongle only (license key without CD) | Additional CP341 in master role when the original CD is already archived |
| Slave | 6ES7870-1AB01-0YA0 | Dongle + Software CD | First CP341 in a slave role; covers both the license key and the engineering media |
| Slave | 6ES7870-1AB01-0YA1 | Dongle only (license key without CD) | Additional CP341 in slave role when the original CD is already archived |
The -0YA0 suffix denotes the bundle (CD + dongle) and is the right choice when the engineering team does not yet own the master or slave CD. The -0YA1 suffix denotes the dongle alone and is the right choice when adding capacity to an existing project that already has the matching CD.
Software Reuse Across Projects
Once a Modbus Master or Slave CD has been purchased (i.e., a -0YA0 order has shipped at least once), the software component may be reused on any number of subsequent projects indefinitely, provided:
- The CD is archived in the engineering office.
- No new STEP 7 / TIA Portal feature pack requires a driver version newer than the one on the CD that would force a media upgrade.
- The role of the CD (master or slave) matches the role of the dongle in the new project.
If the driver is upgraded to a newer revision (for example, to support a new function code or to fix a known bug), the original CD is superseded. The upgrade media is delivered as a new CD; it does not require a new dongle as long as the dongle role is unchanged. The new CD then becomes the reference media for future projects.
Ordering Strategy for Repeated Projects
For an integrator that delivers N projects, each containing M Modbus-enabled CP341s, the minimum legal acquisition is:
- 1 × Master CD bundle (6ES7870-1AA01-0YA0) for the first master CP341 ever deployed.
- 1 × Slave CD bundle (6ES7870-1AB01-0YA0) for the first slave CP341 ever deployed.
- (N·M − 1) × Master dongle (6ES7870-1AA01-0YA1) for each subsequent master CP341.
- (N·M − 1) × Slave dongle (6ES7870-1AB01-0YA1) for each subsequent slave CP341.
This yields the lowest license cost while remaining compliant. The same strategy applies when scaling within a single large project: one -0YA0 bundle per role and one -0YA1 dongle per additional CP341 of that role.
Installation and License Activation Procedure
- Mount the dongle. With the S7-300 powered down, seat the dongle PCB onto the two-pin license header on the front of the CP341. The connector is keyed; do not force.
-
Install the PtP configuration tool. Insert the CD and run the installer. The tool installs the Modbus loadable driver binary to
C:\Program Files\Siemens\Automation\PtPby default. - Configure the CP341 in HW Config. Insert the CP341 in the S7-300 rail in STEP 7 HW Config, assign parameters, and download the hardware configuration.
- Load the loadable driver. Open the PtP configuration tool, connect to the CP341 over MPI/Profibus, select the role (master or slave) matching the installed dongle, and download the driver to the module's flash.
- Verify license acceptance. The tool reports "License OK" only when the dongle in place matches the driver role selected. If the dongle is absent or wrong-role, the tool blocks the download and reports the diagnostic buffer entry "Wrong or missing license dongle".
- Configure Modbus parameters. Set baud rate, parity, slave address (for slave role) or polling table (for master role), and response timeouts.
- Commission the link. Trigger a single read or write from the STEP 7 user program (FB7 for master, FB8 for slave in the Modbus library) and verify the response.
Master vs Slave Functional Differences
Both roles share the same Modbus function code set, but the programmatic interface in STEP 7 differs:
| Aspect | Modbus Master Role | Modbus Slave Role |
|---|---|---|
| STEP 7 FB | FB7 "MODBMA" (with instance DB) | FB8 "MODBSLA" (with instance DB) |
| Polling direction | Initiates requests to slaves | Responds to requests from a master |
| Slave address | Not applicable to local CP341 | Configured (1–247) in PtP tool |
| Triggering | FB7 called cyclically or by event | FB8 called cyclically to service the receive mailbox |
| Diagnostic behavior | Reports per-slave timeouts | Reports framing or CRC errors from the master |
Both roles use the same CP341 hardware and the same physical dongle connector. Switching a CP341 from master to slave requires changing the dongle, not the hardware.
Verification Steps
After commissioning, verify each Modbus-enabled CP341 in three layers:
- Hardware presence. In HW Config, the CP341 reports no diagnostic errors; SF LED is off.
- License check. In the PtP configuration tool, the "License" field shows "Modbus Master" or "Modbus Slave" matching the intended role.
- Protocol check. Use a Modbus traffic analyzer on the RS-485 segment. For master role, observe outbound function code 03/04/06/16 requests. For slave role, observe inbound requests and outbound responses with correct CRC.
A passing end-to-end test reads a known holding register from the slave (or returns a known holding register to the master) and matches the value bit-for-bit.
Troubleshooting Common Issues
| Symptom | Likely Cause | Remedy |
|---|---|---|
| CP341 SF LED on after power-up, "Wrong or missing license" in diagnostic buffer | Dongle absent, not fully seated, or wrong role | Power down, reseat dongle, confirm MLFB role matches driver |
| PtP tool reports "License OK" but no Modbus traffic on segment | FB7/FB8 not called in OB1, or polling table empty | Add FB call to OB1 with instance DB, populate polling table |
| CRC errors in slave diagnostics with mixed traffic | Baud rate mismatch or RS-485 termination missing | Verify both sides at same baud/parity; add 120 Ω termination at segment ends |
| Master reports slave timeout for a known-good slave | Slave address or inter-frame delay misconfigured | Check slave address (1–247), increase response timeout to ≥ 3.5 character times |
| Driver download fails with "version mismatch" | CD driver revision older than firmware on CP341 | Order current driver CD, reload flash, do not replace dongle |
| FB7 returns error code 0x0001 (timeout) under heavy load | Polling cycle shorter than slave response time | Increase polling interval or split into multiple masters |
Migration and Compatibility Notes
- CP341 to CP341-1: The Modbus dongles are forward-compatible. A master dongle 6ES7870-1AA01-0YA0/0YA1 works on either CP341 (1AH02) or CP341-1 (1CH02). No re-licensing required when migrating from an old to a new hardware revision.
- STEP 7 V5.x to TIA Portal: The CP341 and its Modbus loadable driver are supported from STEP 7 V5.x only. TIA Portal does not provide a native CP341 project path; projects must remain in classic STEP 7. The dongles remain valid.
- End-of-life considerations: The CP341 is in the product phase "classic" per Siemens Product Lifecycle; spares and driver CDs remain orderable through the standard spare-parts channel.
FAQ
Do I need to buy a new Modbus software CD for every project?
No. The CD (master MLFB 6ES7870-1AA01-0YA0 or slave MLFB 6ES7870-1AB01-0YA0) is purchased once per role and reused on every subsequent project, including projects that need only the dongle (6ES7870-1AA01-0YA1 or 6ES7870-1AB01-0YA1). Archive the CD and order dongle-only variants for additional CP341 instances.
Is the Master and Slave dongle hardware identical?
Yes. The PCB, connector, and pinout are physically identical between master and slave dongles. The role distinction is encoded only in the license response the dongle returns to the CP341 at start-up. Swapping roles does not damage hardware; the CP341 simply refuses to load the driver and reports a license error in the diagnostic buffer.
Can I move one dongle between multiple CP341 modules at runtime?
Yes, but only if the modules never run Modbus simultaneously. Each CP341 that needs to run Modbus at the same instant requires its own dongle. Hot-swapping a dongle between modules requires a CP341 restart to re-validate the license.
What happens if I order the wrong dongle role?
The CP341 will refuse the driver download and report a "wrong or missing license" diagnostic event. Replace the dongle with the correct role (6ES7870-1AA01 for master or 6ES7870-1AB01 for slave). The CP341 hardware is undamaged.
Does upgrading the Modbus driver require a new dongle?
No. A driver revision upgrade (for example, to gain support for a new function code) is delivered on a new CD. The existing dongle of the matching role continues to authorize the newer driver as long as the dongle role (master or slave) is unchanged.
Is the CP341 Modbus loadable driver supported in TIA Portal?
No. The CP341 family is configured from STEP 7 V5.x only. Projects must remain in classic STEP 7; TIA Portal does not provide a native CP341 configuration path. Existing dongles remain valid for the lifetime of the CP341 hardware.