Troubleshooting Leuze AS-i Safety Light Beam Replacement on a Siemens CP 342-2 AS-i Master
1. Problem Statement
A Leuze AS-i compact safety light beam (commonly part of the MLD 300 or MLD 500 transceiver/muting family) fails in service. The replacement device is pre-addressed on the bench using a Leuze handheld addressing unit to the original node address. When the new beam is connected to the running AS-i line, the Leuze ASM safety monitor cannot detect the node during a Safe Link code-sequence teach, and the safety output remains in OFF state. Re-teaching with asiMon (Leuze Safety Monitor configuration software) fails with the monitor reporting that the configured code sequence address is unreachable.
The behavior is repeatable across machines equipped with:
- Siemens SIMATIC S7-300 CPU (any 31x/31xC PN/DP that supports the CP 342-2 module).
- Siemens CP 342-2 AS-i Master module (order number 6GK7342-2BA01-0XA0 for the standard variant, 6GK7342-2DA01-0XA0 for the double-master variant, both covered here as "CP 342-2").
- Leuze ASM1/ASM2 Safety Monitor (firmware family 2.x/3.x) connected as an AS-i slave node.
- Leuze ASi compact safety light beam with Safe Link / safety code sequence.
2. System Architecture
Before replacing any safety device on an AS-i line, document the exact physical topology and logical configuration. The CP 342-2 acts as the AS-i v2.1 master, scanning up to 31 standard slaves plus 62 A/B slaves (combined standard + extended addressing). The Leuze ASM safety monitor sits on the same yellow AS-i cable as a standard slave with its own node address (commonly address 1 or 2, but any free address in 1A-31A/1B-31B range).
2.1 Reference Topology
+---[24 VDC PELV/SELV Power Supply]---+
| |
| CP 342-2 (master) |
| 6GK7342-2BA01-0XA0 |
| | |
| +-- AS-i+ -- (yellow cable) -+-----------+--------------+--------+
| +-- AS-i- -- | | | |
| | | | |
| [ASM Safety Monitor] [Light Beam Old] [Light Beam NEW] [I/O]
| Addr: 0x01 (or 1A) Addr: 0x02 (2A) Addr: 0x02 (2A) ...
| Safe Code Seq: ABCD
+-----------+--------------+-----------+----------+
| |
+-- Diagnostic line (RS-232/USB) -- PC running asiMon v3.x
The CP 342-2 communicates with the S7-300 backplane via the P-bus. From STEP 7 (classic V5.5 or TIA Portal V16+ via GSD file GSDML-Vx.xx-Siemens-CP342-2-...), the AS-i process image is mapped into the digital I/O area. Safety functions are NOT evaluated by the CP 342-2 or the S7 CPU; they are evaluated inside the ASM monitor and shared via the AS-i safety code sequence protocol.
2.2 Key Component Roles
| Device | AS-i Role | Address Range Used | Configuration Tool |
|---|---|---|---|
| Siemens CP 342-2 | Master v2.1 | 1-31A / 1B-31B | STEP 7 HW Config / TIA Portal |
| Leuze ASM1/ASM2 Safety Monitor | Safety monitor slave | 1-31A | asiMon v3.x |
| Leuze MLD/Compact Safety Beam | Safety slave (OSSD pair) | 1-31A | asiMon + handheld addressing unit |
| Standard I/O modules (IFM, Wago, Pepperl+Fuchs, etc.) | Standard slaves | 1-31A/1B-31B | CP 342-2 auto-detect |
3. Root Cause Analysis
Three failure modes explain why the CP 342-2 / Leuze ASM combination refuses to accept a pre-addressed replacement light beam during code-sequence teach:
3.1 Stale Code-Sequence Table in ASM Monitor
The ASM stores a per-slave "safe code sequence" (a sequence of pre-defined I/O bit patterns that must toggle on each scan for the slave to be considered present and authentic). The teach procedure learns the sequence of the connected device. If the monitor was taught with the OLD beam and the NEW beam's address has been overwritten to the same address but the slave's internal Safe Link code table differs (different firmware generation, different production batch), the monitor rejects the device as "not code-compliant."
3.2 AS-i Profile ID Mismatch
Each AS-i safety slave exposes an ID code (IO, ID, ID1, ID2). The CP 342-2 maintains a list of expected slaves with their profiles. Leuze has shipped multiple hardware revisions of the compact safety light beam; newer revisions publish a different ID2/ID1 pair (e.g., ID1 = D, ID2 = 1 vs. older ID1 = D, ID2 = 0). The CP 342-2 will flag the new device as "wrong slave configured" or "ID mismatch." The ASM additionally enforces a Safe Link profile check. The fix requires either updating the expected profile in the master (CP 342-2 via STEP 7 / TIA) or re-flashing the ASM with the corresponding descriptor file (.asd).
3.3 Addressed With Handheld Unit But Not Detected by ASM
The Leuze handheld addressing unit writes the address through the AS-i cable using the master-not-required single-master addressing protocol. The CP 342-2 master may not have refreshed its slave list (LPS / List of Projected Slaves) after the change. Until the master re-projects the slave (typically on next power cycle, or via "Activate projected configuration" command), the ASM cannot trigger a code-sequence teach because the slave is marked "absent" in the master's view.
4. Pre-Replacement Verification
Before pulling the failed beam, capture the following to a service log:
- AS-i address of the failed beam (from asiMon or CP 342-2 diagnostics:
0x02, displayed as slave 2). - ASM firmware version (asiMon → System → Device Info, e.g.
ASM2 FW 3.4.1). - Safe code sequence index (asiMon → Configuration → Safe Code Sequence tab).
- CP 342-2 firmware (read via STEP 7: Module → Diagnostics; e.g.
FW 3.0.4on a 6GK7342-2BA01-0XA0). - Light beam part number and revision (e.g.
MLD 500-T4L, Rev.02/2023). - asiMon version (latest release is
asiMon V3.13; older V2.x is deprecated and cannot read newer slaves correctly).
5. Replacement Procedure (Recommended)
5.1 Procedure A - ASM Auto-Detect (Fastest)
- Power down the AS-i segment. Disconnect the failed light beam.
- Leave the new light beam at factory default address 0. Do not pre-address it.
- On the Leuze ASM monitor, enter service mode by pressing the two service buttons (commonly
S1+S2) simultaneously for 3 seconds until LED indicates "Service." - Press the service button sequence described in the ASM operating manual to enter Auto-Detect New Slave mode. The ASM energizes the AS-i line and waits for a new unaddressed slave at the next available code-sequence slot.
- Power up the new light beam. Because it is at address 0, the Leuze ASM recognizes it as a fresh device and assigns it automatically.
- Exit service mode. The ASM restarts and re-enters run mode with the new slave bound.
- If the ASM does not auto-detect, proceed to Procedure B.
5.2 Procedure B - Pre-Addressed Replacement (Standard Method)
- Using a Leuze handheld addressing unit (or compatible unit such as the IFM AC1154), assign the new beam the same address as the failed device (commonly slave 2A, address
0x02). - Connect the new beam to the AS-i cable. Power up.
- Wait for the CP 342-2 to detect the slave (green "Slave OK" LED on the affected slave port in STEP 7 diagnostics, or
0x7Fin the diagnostic buffer for "slave present, configuration OK"). - If the CP 342-2 reports the slave as "wrong ID," open STEP 7 / TIA Portal and accept the new slave profile (master → "Activate projected configuration" or "Adopt actual configuration").
- Open asiMon v3.x. Re-read the ASM configuration from the device (File → Read from Device).
- Navigate to the safe code sequence for the affected light beam (typically the line with the same address).
- Click Teach Safe Code Sequence. The ASM will toggle the safety inputs of the slave and learn the pattern over multiple cycles (typically 5-10 seconds).
- Confirm the teach was successful (asiMon reports "Code Sequence OK" and a CRC checksum).
- Write the configuration back to the ASM (File → Write to Device).
- Perform a full safety validation per EN ISO 13849-1 / EN 62061 before returning the machine to production.
5.3 Procedure C - Profile ID Override (When Hardware Revision Changed)
- From STEP 7 / TIA Portal, open the CP 342-2 properties → "AS-i Configuration" tab.
- Compare the projected slave profile against the actual slave profile reported by the master.
- If the ID1/ID2 differ, update the expected profile to match the new hardware revision. Save and download to the CP 342-2.
- Open asiMon and re-teach the safe code sequence (Procedure B steps 5-9).
- If asiMon continues to reject the slave, the ASM descriptor (
.asdfile) does not support the new profile. Contact Leuze for an updated.asdand flash via asiMon (System → Firmware Update).
6. CP 342-2 Configuration Reference
| Parameter | STEP 7 Path | Typical Value | Notes |
|---|---|---|---|
| Master mode | CP 342-2 Properties → Operating Mode | Protected operation | Required when safety slaves are present |
| Projected slaves (LPS) | AS-i Configuration tab | One entry per slave | Must match new beam ID1/ID2 after swap |
| Diagnosis interrupt | Object properties → Interrupts | Enabled | Reports slave faults to OB82 |
| Automatic address programming | AS-i Master → Parameters | Enabled | Allows single-master handheld addressing |
| Cycle time | Diagnostics | ~5 ms per slave, ~150 ms total | 29 slaves max per master |
| Firmware | Module diagnostics | ≥ 3.0 on 6GK7342-2BA01 | Required for ID1/ID2 diagnostics |
6.1 STEP 7 Diagnostic Buffer Entries (Selected)
| Event ID (hex) | Meaning | Action |
|---|---|---|
| 0x0F01 | Slave present, ID mismatch | Update LPS with new ID1/ID2 |
| 0x0F02 | Slave present, configuration OK | No action |
| 0x0F04 | Slave absent | Check wiring/address |
| 0x0F08 | Peripheral fault on slave | Check slave I/O power |
| 0x0F10 | Master power-on reset | Informational |
| 0x0F20 | Configuration active after "Activate Projected" | Informational |
7. ASI Monitor Configuration Reference
The Leuze asiMon software (current version V3.13, replaces V2.x) provides the configuration interface to the ASM safety monitor. Key operations:
| asiMon Menu Path | Function | Use Case |
|---|---|---|
| File → Read from Device | Upload current ASM config | Mandatory before editing |
| Configuration → Safe Code Sequence | View/change teach sequences | Re-teach after slave swap |
| Configuration → Slave Table | Map address ↔ safety function | Verify correct address binding |
| System → Firmware Update | Flash new ASM firmware or .asd descriptor |
Required for new slave profiles |
| System → Diagnostic Log | Read fault history | Post-failure analysis |
| Diagnostics → Online State | Live status of all monitored slaves | Verify slave is detected |
8. Addressing Tools Reference
Replacement devices must be addressed to the same node number as the failed device. Compatible addressing tools include:
| Tool | Manufacturer | Function | Notes |
|---|---|---|---|
| Leuze Handheld Addressing Unit | Leuze | Sets address via single-master protocol | Native for Leuze safety devices |
| IFM AC1154 | IFM | AS-i addressing and diagnostic unit | Cross-vendor compatible; can read ID1/ID2/ID code |
| IFM AC1254 | IFM | Address programming unit, no PC required | Useful on the shop floor |
| Pepperl+Fuchs VBP-HH1 | Pepperl+Fuchs | Handheld addresser | Industry standard |
| asiMon (software only) | Leuze | Address via master when connected | Requires running ASM |
The handheld addressing unit operates using the AS-i "single-master protocol" and writes the address to the slave's non-volatile memory. The CP 342-2 must have automatic address programming enabled for this to coexist with normal master operation.
9. Troubleshooting Matrix
| Symptom | Likely Cause | Diagnostic Step | Resolution |
|---|---|---|---|
| CP 342-2 LED "Slave Fault" on new beam | Wrong address or ID mismatch | Read STEP 7 diagnostic buffer, look for 0x0F01 | Update LPS in CP 342-2 configuration |
| asiMon reports "Code Sequence Timeout" | New slave profile not in ASM descriptor | Check Diagnostics → Online State | Update .asd via System → Firmware Update |
| Handheld unit writes address but master does not see slave | Master has not refreshed slave list | Cycle AS-i power | Power down/up the AS-i segment |
| Both old and new beam respond to the same address | Old beam still physically present in cable | Visual inspection / cable resistance check | Remove failed beam from the trunk |
| Teach succeeds, but safety output drops after 30 s | Code sequence CRC mismatch | asiMon Diagnostic Log | Re-teach, ensure slave is in steady state |
| CP 342-2 does not detect any slaves after handheld programming | Automatic address programming disabled in master | STEP 7 → CP 342-2 Properties | Enable automatic address programming |
| asiMon V2.x cannot connect to ASM V3.x | Software/firmware mismatch | Check asiMon version | Upgrade to asiMon V3.13 |
| New beam shows default address 0 in asiMon | Handheld not used or write failed | Read ID code with handheld | Re-address using handheld, verify write confirmation |
10. Verification Steps
- Verify physical wiring: AS-i+ on pin 1 (brown), AS-i- on pin 3 (blue) of M12 or AS-i flat cable. Aux 24 V on pins 2/4 if the slave uses external power.
- Verify slave LED status on the new beam: green = bus OK + address OK, red = bus fault or address conflict.
- Confirm CP 342-2 slave list shows the new beam as "OK" (STEP 7 online → CP 342-2 → AS-i diagnostics).
- Confirm ASM Online State shows the new beam as "Active" with green status and the correct safe code sequence CRC.
- Perform a manual safety validation test: interrupt the light beam and verify the safety output (ASM relay or AS-i safety bit) de-energizes within the response time (typically ≤ 40 ms for Leuze ASM with light beam).
- Restore the safety output by clearing the beam and cycling the ASM reset input.
- Document the replacement in the machine safety log per EN ISO 13849-1, including part numbers, serial numbers, date, technician, and validation test result.
11. Extended Diagnostics
When the standard procedures do not resolve the issue, deeper diagnostics are required:
11.1 AS-i Cable Quality
An AS-i segment tolerates up to 100 m total length with a max resistance of 7 ohms per conductor segment. Use an AS-i line tester (IFM AC1254, Pepperl+Fuchs VBP-HH1, or Wago 750-921) to verify:
- Voltage at the end-of-line > 26 VDC (allowed range 18-31.6 V).
- No shield ground loops.
- Reflection / signal integrity under load.
11.2 EMC Interference
If the safety beam drops intermittently after replacement, suspect EMI from a VFD or welding transformer sharing the same cable tray. Add a ferrite on the AS-i cable at the master end and verify the shield (if used) is bonded at one end only.
11.3 Master-Slave ID Code Comparison
Use the IFM addressing unit's ID code read function to extract the raw I/O, ID, ID1, and ID2 values from the new beam. Compare against the expected values in the CP 342-2 LPS file. Any deviation in ID1 or ID2 confirms a hardware revision difference and requires the corresponding action in Procedure C.
12. Standards and References
- IFM - AS-i System Integration and Setup: Addressing basics, hand-held addressing units, automatic addressing workflows.
- IFM - AS-i Addressing and Diagnostic Units: Catalog of AC1154, AC1254, and other compatible tools.
- AS-Interface International (
as-interface.net): AS-i v2.1 and v3.0 specification documents for ID code definitions. - EN ISO 13849-1: Safety of machinery - Safety-related parts of control systems.
- EN 62061 / IEC 61508: Functional safety of electrical/electronic safety systems.
13. Frequently Asked Questions
Why does the Leuze ASM refuse to teach the safe code sequence after I pre-addressed the replacement light beam?
The ASM validates the device profile (ID1/ID2) and the safe code sequence table together. If the replacement beam has a different hardware revision, its ID code differs from what the ASM descriptor (.asd) expects. Re-flash the ASM with the current .asd via asiMon V3.x (System → Firmware Update), then re-teach the code sequence.
Do I need a Leuze handheld addressing unit, or can I use a third-party addresser?
Any AS-i single-master addressing unit works, including the Leuze handheld, IFM AC1154/AC1254, or Pepperl+Fuchs VBP-HH1. The addressing protocol is standardized. The advantage of the Leuze unit is direct read-out of the Safe Link parameters, but functionally any compliant unit can set the address.
Can I leave the new beam at address 0 and let the ASM auto-detect?
Yes - Procedure A above. This works only when the ASM is in service mode and supports auto-detect for the relevant slave type. If auto-detect fails, fall back to Procedure B (pre-address to the same address as the failed device).
Which asiMon version is required to read an ASM with current firmware?
asiMon V3.13 (or later in the V3.x stream). asiMon V2.x cannot reliably connect to ASM V3.x firmware and may report incorrect slave profiles. Always pair the latest asiMon with the latest ASM firmware.
Is the CP 342-2 involved in safety evaluation?
No. The CP 342-2 is a non-safety AS-i master. It transports the safety code sequence bits but does not evaluate them. The Leuze ASM is the safety evaluator. Replacing a safety device requires re-teach on the ASM, but the CP 342-2 only needs its LPS (List of Projected Slaves) updated to match the new device's ID code.