Resolving CPU 319-3 PN/DP STOP on CANopen-DP Gateway Power-Up

David Krause16 min read
ProfibusSiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

1. Problem Statement

A Siemens SIMATIC S7-300 CPU 319-3 PN/DP (typical catalog number 6ES7318-3EL01-0AB0) is configured with a TP1500 Comfort HMI on PROFINET, a programming device (PG) on PROFINET, and a third-party CANopen-DP/2 gateway on the integrated PROFIBUS-DP interface. The user downloads the STEP 7 / TIA Portal project (including the gateway GSD file) and the CPU enters RUN. As soon as the 24 V DC supply of the CANopen-DP/2 gateway is switched on, the CPU drops back to STOP automatically, even though all four status LEDs on the gateway are green/active.

Two follow-on issues are observed once OB86 (Rack Fault) is inserted to keep the CPU in RUN:

  • Issue #1 – The diagnostic buffer of the CPU shows a continuously repeating pair of events: Station Failure followed by Station Return on the distributed I/O (DP slave). This indicates that the CPU detects the gateway on PROFIBUS but loses it cyclically.
  • Issue #2 – The user is new to CANopen and needs a methodical procedure to (a) address the gateway correctly, (b) wire/terminate the CAN segment, and (c) move SDO/PDO traffic between the S7-300 and the FAULHABER MCBL 3006 S AES CO drive.
Engineering rule: If a CPU goes to STOP the moment a DP slave is energized, the cause is almost always one of the following: (1) PROFIBUS address mismatch between the DIP switches and the STEP 7 / TIA Portal configuration, (2) GSD file does not match the gateway firmware, (3) a missing or wrong I/O length in the slot configuration, (4) termination on the DP segment is incorrect, or (5) the diagnostic interrupt of the gateway is calling an OB that has not been loaded.

2. System Topology and Components

The complete reference topology is summarized below. The CANopen-DP/2 gateway acts as a PROFIBUS-DP slave (per IEC 61158 / PROFIBUS-DP slave CANopen-DP/2) and as a CANopen master on the secondary side, exposing 240 bytes of process input and 240 bytes of process output to the DP master.

Node Role Bus Address / Ident Key Part Numbers
S7-300 CPU 319-3 PN/DP DP master / PROFINET controller PROFIBUS-DP (X2) + PROFINET (X1) DP master, default 2 6ES7318-3EL01-0AB0
TP1500 Comfort HMI PROFINET Assigned by topology 6AV2 124-1MC01-0AX0 (typical)
Programming device (PG) Engineering PROFINET — Field PG or PC with Ethernet
CANopen-DP/2 gateway DP slave / CANopen master PROFIBUS-DP + CANopen 17 decimal (= 0x11 hex, default) Manufacturer-specific (Helmholz, HMS, Intreis, etc.)
FAULHABER MCBL 3006 S AES CO CANopen drive controller CANopen Configured in gateway (typical node 1) MCBL3006SAESCO family
FAULHABER motor Brushless DC, 24 V — — 3242 G024 BX4

The gateway is shipped with a default PROFIBUS address of 0x11 (17 decimal), which the user must set both on the rotary DIP switches of the device and in the STEP 7 / TIA Portal hardware configuration. The T-connector, cables, and terminations referenced (C.1311.03 T-connector, C.1323.03 0.3 m cable, C.1322.03 0.3 m cable, C.1301.01 / C.1303.01 terminators) are standard CANopen accessories, typically supplied by IXXAT or HMS/IXXAT, and follow CiA DS 301 / DS 303-1 pin-out conventions.

3. PROFIBUS DP Slave Diagnostics in the S7-300

An S7-300 CPU monitors the PROFIBUS-DP segment in two ways:

  1. Cyclic I/O exchange (DP-V0): The CPU polls each configured slave every bus cycle. If a slave does not respond within the configured watchdog time, the CPU raises a station failure and – if no OB86 is loaded – transitions to STOP. This is the most likely cause of the reported CPU goes to STOP when 24 V is applied to the gateway symptom.
  2. Diagnostic interrupts (DP-V1): The slave signals a status change (for example, module status changed or channel diagnosis available). The CPU invokes OB82 (diagnostic interrupt). If the gateway reports an extended diagnostic that the master does not handle, the CPU may also go to STOP depending on the configured behavior.

The full PROFIBUS DP slave state machine implemented in the CPU is documented in the Siemens SIMATIC S7-300 automation system / CPU 31xC and CPU 31x: Installation and Operating Manual. The relevant organization blocks are:

OB Name Trigger Effect if missing
OB82 Diagnostic interrupt DP slave signals diagnostic change CPU goes to STOP
OB85 Program execution error I/O access error on a non-existing / failed slave CPU goes to STOP
OB86 Rack failure DP station failure / return CPU goes to STOP
OB122 I/O access error Direct I/O access to a failed slot CPU goes to STOP

Inserting OB86 alone is not enough; the project must also contain OB82, OB85, and OB122 as empty OBs, and the user program must not use direct I/O access (e.g. L IW 0) on a slot that has not been confirmed by the gateway.

4. Root Cause Analysis of the CPU STOP Transition

Five failure modes explain 95 % of "CPU drops to STOP at the moment a DP slave is energized" incidents. Work through them in this order:

  1. DIP switch / project address mismatch. The gateway is set to 0x11 (17) on the rotary coding switch, but the project uses a different value, or the project address is correct but the leftmost (1's) switch group is in the wrong position. The CPU therefore tries to address a station that does not exist, raising station failure.
  2. GSD file mismatch. The GSD file installed in TIA Portal does not correspond to the firmware on the gateway. The slave replies, but the master rejects the parameter telegram, and the slave enters wait-for-parameterization indefinitely.
  3. Module / slot configuration mismatch. The user has added modules in the device view of TIA Portal that the gateway cannot provide (e.g. 32 words output where only 8 are mapped), or has left the default empty slot configuration. The gateway signals a configuration error, the master raises OB86 with diagnosis module configuration error, and the CPU goes to STOP.
  4. PROFIBUS termination error. Termination ON at the CPU and at the gateway is correct, but a third termination on a T-connector or stub is left enabled. The reflections corrupt the parameterization telegram.
  5. 24 V supply wiring or shield. A missing PE / shield bond, or a DC common that is not tied between the CPU rack and the gateway PSU, can raise common-mode noise that causes sporadic station failure / return, exactly the symptom reported in Issue #1.

The diagnostic buffer entries "Station Failure" then "Station Return" cyclically, while the gateway LEDs are all green, is the signature of case 2 or 5: the gateway briefly accepts the parameterization, then loses it, then re-accepts. This can also indicate that the gateway's watchdog is shorter than the master's slot time; the slave believes the master has gone away and resets, only to be re-parameterized on the next cycle.

5. Reading and Interpreting the Diagnostic Buffer

Open the project in TIA Portal, go online, and select Online & diagnostics → Diagnostics buffer on the CPU. The buffer is read-only and time-stamped. Look specifically for entries that contain:

  • Station failure – event ID 0xE380 for DP, 0xE382 for PROFINET.
  • Station return – event ID 0xE381 / 0xE383.
  • Distributed I/O: station failure – OB86 was called but the user has not processed OB86_START_INFO to identify the failed slot.
  • I/O access error when reading – OB85 / OB122 (user program reads a non-existing input word).

For every station failure entry, drill into the Details pane. The logical base address of the failed DP slave is shown; compare it to the configured I/O start address in the device view. If the address does not match, the user has not selected the same physical PROFIBUS address that is set on the gateway's DIP switches.

Tip: Temporarily set the gateway to a different PROFIBUS address (e.g. 18) and update the project. If the CPU still drops to STOP, the problem is not the address; it is the GSD, configuration, or wiring. This is a fast, reversible isolation technique.

6. Installing the GSD File and Configuring the CANopen-DP/2 Gateway

The CANopen-DP/2 gateway is a PROFIBUS-DP slave conforming to IEC 61158 with 240 bytes input and 240 bytes output. To integrate it in TIA Portal V16 or later:

  1. Download the GSD file (typically *.gsd or *.gsd.gz) from the gateway manufacturer's support page. Do not import a GSD from a different firmware revision.
  2. In TIA Portal: Options → Manage general station description files (GSD) and point to the downloaded file. TIA installs it under Other field devices → PROFIBUS DP → Gateway in the hardware catalog.
  3. Drag the gateway into the PROFIBUS subnet. Set the PROFIBUS address to 17 to match the DIP switch (0x11 = 17 decimal).
  4. Open the device view of the gateway. Insert exactly the modules that correspond to the CANopen I/O image the user needs. Typical layout for a single FAULHABER drive is:
    • Slot 0 – gateway diagnostics (8 bits input)
    • Slot 1 – Universal module (configurable PDO length, e.g. 8 bytes input / 8 bytes output)
    • Slot 2 – second universal module if more PDOs are required
  5. For each universal module, configure the start addresses so that the cycle OB (OB1) can address them. The default I/O start address in TIA is shown in the properties of the slot, e.g. IW 256 / QW 256.

Save, compile, and download the hardware configuration only (not the user program) to the CPU, then go online and observe whether the gateway reports DP-V1 diagnostic: OK in the diagnostic buffer. If yes, the parameterization is correct; the CPU will no longer go to STOP at power-up.

7. Handling the Universal Module in TIA Portal

The "universal module" is a configurable slot whose length is set by the gateway's configuration tool, not by TIA Portal. The mapping is:

TIA Portal side Gateway configuration tool side Data flow
Process inputs (PIW / IB) Receive PDO (RPDO) from the CANopen drive CAN → DP → PLC
Process outputs (PQW / QB) Transmit PDO (TPDO) sent by the PLC PLC → DP → CAN

To add or resize a universal module:

  1. Open the gateway's configuration tool (e.g. Helmholz ToolBox, HMS IXXAT CANopen Configurator, or Intreis CW-CONFIG). The tool is supplied by the gateway vendor, not by Siemens.
  2. Import the EDS / DCF file of the FAULHABER MCBL 3006 S AES CO drive. The standard FAULHABER EDS file follows CiA 301 / CiA 402.
  3. Map the desired TPDOs of the drive to the gateway's internal image at the byte offset that matches the universal module configured in TIA Portal. For example, if the universal module starts at input byte 0 and is 8 bytes long, map TPDO1 (statusword, actual position, actual velocity) to bytes 0..7 of the gateway image.
  4. For SDOs (acyclic, parameter channel), leave one of the slots configured as SDO rather than PDO. The SDO is accessed via RDREC / WRREC in the user program (see next section).
  5. Export the gateway configuration to the device (typically via USB or the gateway's web UI). The gateway stores it in non-volatile memory; the configuration is retained across power cycles.
Field-proven pitfall: If the length in TIA Portal and the gateway's configuration tool differ by even one byte, the gateway will signal configuration fault at parameterization. The CPU invokes OB86 with diagnosis "module configuration error" and – without OB86 – goes to STOP. Always verify the total I/O length with the gateway's diagnostics page.

8. SDO and PDO Exchange Through the CANopen-DP/2 Gateway

There are two classes of CANopen traffic over the gateway:

  • PDO (Process Data Object) – cyclic, real-time, mapped directly to the I/O image. The PLC reads IB x / writes QB x in OB1 and the gateway does the rest.
  • SDO (Service Data Object) – acyclic, used for parameterization (e.g. setting the position loop gain, reading the device name, changing the node ID). On PROFIBUS-DP-V1, SDOs are transported using the RDREC / WRREC system function blocks.

A typical SCL snippet to read an SDO from the FAULHABER drive (object 0x1008 — manufacturer device name) on slot 1 of the gateway at DP address 17 is:

// Read SDO: index = 0x1008, subindex = 0x00
#status := RDREC(
    REQ     := TRUE,
    ID      := 17,                         // PROFIBUS address of gateway
    INDEX   := 16#1008,                    // CANopen object dictionary index
    MLEN    := 4,                          // record length
    VALID   := #valid,
    BUSY    := #busy,
    ERROR   := #error,
    STATUS  := #rec_status,
    LEN     := #rec_len,
    RECORD  := #sdo_buffer);               // destination P#DBX0.0 BYTE 4

For a write, use WRREC with the SDO payload in little-endian byte order. The INDEX parameter of RDREC / WRREC on a CANopen-DP/2 gateway corresponds to the CANopen object dictionary index; the gateway performs the SDO segment transfer to the drive and returns the result on the next call.

For motion control (profile torque, profile velocity, profile position modes per CiA 402), send the appropriate controlword (0x6040), target position (0x607A), and modes of operation (0x6060) as SDOs at startup, then operate the drive cyclically via PDOs in OB1 for low latency.

9. PROFIBUS Wiring, Termination, and Shielding Best Practices

The user's wiring description is technically correct in topology but contains two common termination mistakes. Apply the following checklist, derived from the Eaton SmartWire-DT gateways / CANopen and PROFIBUS-DP commissioning guide and the general PROFIBUS installation guidelines:

  1. Terminations count. A PROFIBUS segment must have exactly two terminations, one at each physical end of the trunk. The CPU (X2) and the gateway are both ends — both terminations ON, no others. If the T-connector on the CAN side has its own 120 Ω terminator (C.1301.01), verify it is enabled only at the two physical ends of the CAN segment.
  2. Stub length. Keep CAN stubs as short as possible (< 0.3 m for 1 Mbit/s) and use the dedicated stub cables (C.1323.03 / C.1322.03 in the user's case).
  3. Shield bonding. Bond the PROFIBUS cable shield to functional earth at both ends, using 360° low-impedance clamps. For CAN, bond the shield at both ends as well, with a low-pass RC network (1 MΩ in parallel with 1 nF) at one end only if a ground loop is present.
  4. 24 V DC common. The M (0 V) of the gateway PSU must be tied to the M of the S7-300 PSU. Floating grounds will create a common-mode voltage that the gateway's CAN driver interprets as bus errors and the master sees as station failure.
  5. Baud rate. For 1.5 Mbit/s PROFIBUS, the maximum stub length drops to 0.3 m. For 12 Mbit/s, stubs are not allowed at all. The user has not stated the baud rate; if the default 1.5 Mbit/s is in use, the wiring is fine; if 12 Mbit/s is forced, the T-connector C.1311.03 between the gateway and the drive may be too long.

For a deeper treatment of the same engineering rules applied to DP gateways, the ABB PROFIBUS DP devices overview provides a useful reference architecture, particularly for the segment topology and the maximum 32-station rule.

10. FAULHABER Drive Commissioning from TIA Portal

The user has already proved the drive electrically by running it in FAULHABER Motion Manager. To drive it from the S7-300:

  1. In Motion Manager, export the drive's EDS file and the current configuration. Note the configured node ID (default 1) and the active TPDOs / RPDOs.
  2. In the gateway configuration tool, scan the CAN bus, add the drive with the correct node ID, and assign TPDO1 → Statusword / actual position to byte 0 of the gateway image, TPDO2 → actual velocity / actual current to byte 8, and so on.
  3. Map RPDO1 (Controlword / target position) to the corresponding output bytes in the gateway image.
  4. In TIA Portal, add a universal module of the right size in the device view of the gateway. The PLC start address is, for example, IB 256 … IB 271 for inputs and QB 256 … QB 271 for outputs.
  5. In OB1, copy the controlword into QB 256 (e.g. 0x0006 for Shutdown, 0x0007 for Switch On, 0x000F for Enable Operation, 0x003F for New Set-point) and the target position into QD 258.

For SDO access to objects such as 0x6060 (modes of operation) and 0x6081 (profile velocity), use WRREC as shown in section 8. Always switch the drive to the desired mode of operation (1 = profile position, 3 = profile velocity, 6 = homing) with an SDO write to 0x6060 before issuing cyclic PDO commands, or the drive will report a mode of operation not supported emergency message.

11. Verification and Commissioning Checklist

Before declaring the system commissioned, verify every line of the table below. Each row corresponds to a measurable condition.

Step Action Pass criterion
1 Power cycle the gateway with the CPU in RUN CPU stays in RUN; SF / BF LEDs on the CPU remain off
2 Go online and open the diagnostic buffer No new Station Failure entries; only the initial Station Return
3 Read the gateway's DP-V1 diagnostics in TIA "Module OK", no channel diagnostics pending
4 Force QB 256 := 0x0006 in OB1 (Shutdown command) Drive statusword returns 0x0631 (Not ready to switch on → Switch on disabled)
5 Force QB 256 := 0x0007 (Switch on) then 0x000F (Enable) Drive statusword returns 0x0637 (Operation enabled)
6 Write SDO to 0x6060 = 1 (profile position) WRREC returns STATUS = 0 (no error)
7 Issue a target position via PDO and toggle bit 4 of controlword (new set-point) Drive moves to the commanded position
8 Power off the gateway and power it back on CPU remains in RUN; OB86 fires once with Station Failure then Station Return
9 Remove the 24 V DC common between the PSUs CPU must not be allowed to remain in RUN with floating ground; this is a configuration check only
Safety: The 24 V DC FAULHABER motor can produce a stall current sufficient to damage the gearbox. Always command a low speed first (SDO write to 0x6081 with a value < 1000 rpm) and verify direction before issuing a position command.

12. Frequently Asked Questions

Why does the CPU go to STOP the moment I apply 24 V to the CANopen-DP gateway?

The CPU raises a station-failure event as soon as the gateway is energized because the gateway's PROFIBUS address (DIP switch) does not match the address configured in TIA Portal, or the GSD file does not match the gateway firmware, or the I/O length configured for the universal module does not match the gateway's image. Insert OB82, OB85, OB86, and OB122 as empty OBs, then go online, open the diagnostic buffer, and compare the failed logical base address to the project's configured address.

What is the difference between a PDO and an SDO on the CANopen-DP/2 gateway?

A PDO (Process Data Object) is cyclic, real-time, and is mapped directly to the I/O image of the S7-300 (e.g. IB 256 for inputs, QB 256 for outputs). An SDO (Service Data Object) is acyclic and is used for parameterization, accessed in the PLC via the RDREC and WRREC system function blocks, with the CANopen object dictionary index passed in the INDEX parameter.

How many bytes of process data does the CANopen-DP/2 gateway expose to the S7-300?

Per the CANopen-DP/2 product specification, the gateway provides up to 240 bytes of process input and 240 bytes of process output to the PROFIBUS-DP master, in any combination of universal modules as long as the total length does not exceed 240 bytes per direction.

Do I need a special configuration tool for the gateway, or can I do everything from TIA Portal?

You need the gateway vendor's configuration tool (Helmholz, HMS, Intreis, etc.) to map the CANopen PDOs/SDOs of the FAULHABER drive to the gateway's internal image and to set the CANopen master parameters (baud rate, node IDs, heartbeat / guarding). TIA Portal only sees the gateway as a PROFIBUS-DP slave with N universal modules; the meaning of the bytes inside those modules is defined by the gateway tool.

Can I leave OB86 alone and still keep the CPU in RUN if the gateway drops off the bus?

OB86 by itself is sufficient to prevent the CPU from going to STOP on a station failure, but you should also load empty OB82, OB85, and OB122 OBs. Without OB85 and OB122, a direct I/O access (e.g. L IW 256) to a slot that has just failed will still send the CPU to STOP. Always use symbolic I/O access or check the IOFLAG of the process image before reading.

Back to blog