Configuring SINAMICS S120 Trace Function via PLC p4730 BICO

David Krause15 min read
SiemensTutorial / How-toVFD / Drives
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

Overview: SINAMICS S120 Trace Function and PLC-Based Configuration

The SINAMICS S120 drive system includes an integrated trace (function generator / recorder) used to capture internal drive variables such as speed actual value, current, torque, setpoint/actual deviation, and BICO connector states over time. Engineers normally configure the trace from STARTER (classic commissioning tool) or Startdrive / TIA Portal. In many automation cells, however, the trace must be armed, parameterized, and triggered directly from a higher-level controller such as a SIMATIC S7-1500, S7-1200, or SIMOTION — without a PC attached at runtime.

The PLC writes parameter values to the drive over PROFINET (or PROFIBUS) using cyclic or acyclic services. To configure trace signal selection from a PLC, the engineer must write the parameter p4730 (and its companion indices p4731 through p4737) with the correct connector encoding. This article documents the parameter layout, BICO connector format, the meaning of DO Id, chart Id, block Id, and PIN Id, the recommended read-back procedure for reverse-engineering the format, and a working PLC code example for arming the trace.

Reference: Defining and using the trace function in TIA Portal (Siemens Support ID 109822276).

Prerequisites

Before configuring the S120 trace from a PLC, verify the following:

  • SINAMICS S120 firmware V4.x or V5.x (CU320-2 control unit). The trace parameter set is identical between firmware V4.4, V4.7, V4.8, V5.1, and V5.2; only the firmware-level SINAMICS support package (SSP) for STARTER changes.
  • STARTER / Startdrive installed for the offline parameter discovery step (to read out a configured trace and confirm the encoding).
  • PROFINET or PROFIBUS connection between the SIMATIC controller and the SINAMICS CU320-2. The drive must be reachable as a PROFINET IO device on the configured subnet.
  • Configured telegram (e.g., telegram 1, 2, 3, 5, 6, 102, 105, 106, 116, 118, 125, 126, 136, 138, 139, 166, 220, 391) — telegrams that include STW2/ZSW2 and the appropriate extension slots for the trace trigger are recommended when using extended control words.
  • The drive object list known to the PLC: Control Unit (DO 1), Infeed (typically DO 2), Motor Module / Drive Axis 1 (typically DO 3), and any additional axes / TM modules.

SINAMICS S120 Trace Parameter Map (p4720 – p4799)

The S120 trace is configured entirely through parameters in the p4720 – p4799 range. The most relevant subset for PLC-based configuration is shown below.

Parameter Name Index Meaning
p4720 Trace memory size (samples) [0] Number of samples to record (e.g., 1000, 4000, 8000)
p4721 Trace trigger condition [0] 0 = immediate, 1 = positive edge, 2 = negative edge, 3 = both edges, 4 = level high, 5 = level low
p4722 Trace trigger threshold [0] Threshold value for trigger source comparison
p4723 Trace trigger delay [0] Delay (samples) between trigger event and start of capture
p4724 Trace sampling time (cycles) [0] Number of current controller cycles between samples
p4730 Trace record signal — Trace 0 [0..5] Signal selection in BICO connector format
p4731 Trace record signal — Trace 1 [0..5] Signal selection in BICO connector format
p4732 Trace record signal — Trace 2 [0..5] Signal selection in BICO connector format
p4733 Trace record signal — Trace 3 [0..5] Signal selection in BICO connector format
p4734 Trace record signal — Trace 4 [0..5] Signal selection in BICO connector format
p4735 Trace record signal — Trace 5 [0..5] Signal selection in BICO connector format
p4736 Trace record signal — Trace 6 [0..5] Signal selection in BICO connector format
p4737 Trace record signal — Trace 7 [0..5] Signal selection in BICO connector format
p4740 Trace trigger signal [0..5] Trigger source in BICO connector format
p4750 Trace recording type [0] 0 = single, 1 = continuous, 2 = continuous with averaging
p4751 Trace control word (drive-internal) [0] Bit-coded start/stop/save/abort of the trace
r4752 Trace status word (drive-internal) [0] Read-only status (running, triggered, full)
r4760 Trace data block address [0..7999] Recorded samples, read out as raw words
Note: The list above covers the standard trace parameter set. The exact upper index range of r4760 depends on the configured memory size in p4720. The drive returns F08501 if the trace configuration is inconsistent (for example, a non-existent connector on a Drive Object).

Parameter p4730 Index Layout: BICO, DO/Chart, and Block/PIN Encoding

Every trace channel is selected with a six-index parameter. For Trace 0 (the first channel), the indices mean:

Index Field Description
p4730[0] Trace 0 parameter, BICO format Direct BICO connector number (e.g., 15 = r0063 speed actual, 84 = r0079 torque setpoint, 12 = r0079 smoothed)
p4730[1] Trace 1 parameter, BICO format BICO connector number for Trace 1 (if Trace 1 is to use the same DO/chart/PIN source family as Trace 0)
p4730[2] Trace 0 PINx with DO Id and chart Id Encoder triplet: Drive Object Id, chart Id, PIN Id for Trace 0
p4730[3] Trace 0 PINx with block Id and PIN Id Alternative encoding using function-block Id and PIN Id instead of chart Id
p4730[4] Trace 1 PINy with DO Id and chart Id Encoder triplet for Trace 1
p4730[5] Trace 1 PINy with block Id and PIN Id Alternative encoding for Trace 1 using block Id

The same index layout applies to p4731 – p4737 for Trace 2 – Trace 7, and to p4740 for the trigger signal.

Decoding DO Id, Chart Id, Block Id, and PIN Id

When writing trace signal selection by index 2 / 3 (or 4 / 5), the value placed into the parameter index is a compound 32-bit integer that the SINAMICS firmware decodes internally. The fields are:

  • Drive Object Id (DO Id) — numeric identifier of the source DO. Typical values:
    • 1 = Control Unit (CU)
    • 2 = Infeed (Line Module / Active Line Module)
    • 3 = Drive Axis 1 (Motor Module 1 / Motor 1)
    • 4 = Drive Axis 2 (if present)
    • 5+ = Additional DOs, Terminal Modules (TM31 = typically 8, TM41 = typically 9, Sensor Modules SMC10/20/30, etc.)
  • Chart Id — identifier of the function chart (logic diagram) in the SINAMICS List Manual that contains the desired PIN. Examples: chart 1700 = setpoint channel, chart 2000 = V/f open-loop, chart 2700 = vector control, chart 5000 = technology controller. The chart Id is needed when you want a signal that is not exposed as a named parameter.
  • Block Id — alternative to chart Id when the function block exposes a named output (e.g., speed controller, current controller). Use either chart Id or block Id, not both.
  • PIN Id — connector number within the chart or block. PIN Ids correspond to the numbered output pins of a function block (e.g., output n_act_int = connector 15 on the speed controller block).

The combined value written into the parameter is calculated from these four components and depends on the firmware version's encoding scheme. The encoding is documented in the SINAMICS S120 Function Manual "Communication / Non-cyclic communication", section 11.1.4.5 ("Writing connectors into parameters").

Recommended Discovery Procedure: Read a Configured Trace First

The fastest path to a working PLC configuration is to let STARTER create a trace, then read the resulting parameter values back. This confirms the exact encoding expected by the firmware in your project.

  1. In STARTER (or Startdrive), navigate to Drive > Trace, click New trace, and add two channels (e.g., speed actual value r0063 and torque actual value r0080).
  2. Configure sampling time, memory size, and trigger condition; click Apply. STARTER writes the configuration to the drive and to the offline project.
  3. Online, right-click the drive and choose Expert list. Filter for p4730 through p4737 and p4740; read every index.
  4. Note the exact decimal/hex values stored in p4730[0..5]. The value of p4730[0] is the BICO connector number; p4730[2] and p4730[3] are the DO/Chart/PIN compound values.
  5. Use these values as the source-of-truth constants in your PLC code. Because the encoding is firmware-dependent, hard-coding without a STARTER reference is not advisable.
Engineering tip: Save the STARTER offline project so the trace parameter set travels with the machine documentation. Any PLC that configures the trace must use the same values that STARTER generated; mismatched encoding produces F08501 "Trace: signal source invalid" or silently records zero data.

How to Write Connectors into Parameters (Firmware Reference)

Section 11.1.4.5 of the SINAMICS S120 Function Manual (FH1) defines how a non-cyclic PLC write must format a connector source into a parameter index. The PLC must issue the write as a parameter request using the request tag (e.g., REQ) and receive the response on the response tag (e.g., DONE / ERROR / STATUS) on the assigned drive object.

The key rules are:

  1. Each write is per (DO, parameter number, parameter index). To write a single BICO connector source you address (DO Id, p4730, index) with the required 16-bit or 32-bit unsigned value.
  2. All writes must be issued in the same order as the STARTER offline configuration. SINAMICS rejects out-of-order writes that leave the trace in an inconsistent state.
  3. If a write is rejected with status 0x80B1 ("invalid value") or 0x80B2 ("value too high/low"), the firmware is rejecting the connector encoding — re-check chart Id / block Id / PIN Id against the List Manual.
  4. Set the BICO source before arming the trace. Writing p4751 (trace control word) without a valid BICO source on at least one of p4730[0..5] produces a trace that runs but records zeros.

PLC Code Example (S7-1500 / TIA Portal, SCL)

The example below writes a trace configuration to Drive Axis 1 (DO 3) using the standard S7 blocks RDREC / WRREC over PROFINET. The hardware identifier (HW ID) of the SINAMICS DO is the slot number configured in the device configuration (e.g., HW ID 3 for the first drive axis).

// FB_S120_TraceArm — arm a SINAMICS S120 trace from a SIMATIC S7-1500
// Inputs:
//   i_hwId      : HW identifier of the Drive Object (PROFINET slot)
//   i_doId      : Drive Object number (1 = CU, 2 = Infeed, 3 = Drive Axis 1, ...)
//   i_bico0     : BICO connector for Trace 0 (e.g., 15 = r0063 n_act)
//   i_bico1     : BICO connector for Trace 1 (e.g., 84 = r0079 M_set)
//   i_dochart0  : (DO Id, Chart Id, PIN Id) compound for Trace 0
//   i_dochart1  : (DO Id, Chart Id, PIN Id) compound for Trace 1
//   i_memSize   : p4720 — number of samples (e.g., 1000)
//   i_trigger   : p4721 — 0=IMM, 1=PE, 2=NE, 3=BE, 4=HIGH, 5=LOW
//   i_thresh    : p4722 — trigger threshold (REAL → DWORD cast)
//   i_delay     : p4723 — sample delay
//   i_cycles    : p4724 — current-controller cycles per sample

FUNCTION_BLOCK FB_S120_TraceArm
VAR
    tWriteReq   : TCON #0;   // WRREC input type alias
    tWriteResp  : BOOL;
    tStatus     : DWORD;
    nStep       : INT := 0;
    xBusy       : BOOL;
    xDone       : BOOL;
    xError      : BOOL;
    wErrId      : WORD;
END_VAR

CASE nStep OF
    0:  // Initial — kick off the first write
        nStep := 10;
    10: // p4720 — trace memory size (samples)
        WRREC(REQ := TRUE, ID := i_hwId,
              INDEX := 4720,
              RECORD := UINT_TO_WORD(i_memSize),
              DONE => tWriteResp,
              BUSY => xBusy,
              ERROR => xError,
              STATUS => tStatus);
        IF tWriteResp THEN nStep := 20; END_IF;
    20: // p4721 — trigger condition
        WRREC(REQ := TRUE, ID := i_hwId,
              INDEX := 4721,
              RECORD := UINT_TO_WORD(i_trigger));
        nStep := 30;
    30: // p4722 — trigger threshold (REAL)
        WRREC(REQ := TRUE, ID := i_hwId,
              INDEX := 4722,
              RECORD := REAL_TO_DWORD(i_thresh));
        nStep := 40;
    40: // p4730[0] — Trace 0 BICO source
        WRREC(REQ := TRUE, ID := i_hwId,
              INDEX := 4730, SUBINDEX := 0,
              RECORD := UINT_TO_DWORD(i_bico0));
        nStep := 50;
    50: // p4730[1] — Trace 1 BICO source
        WRREC(REQ := TRUE, ID := i_hwId,
              INDEX := 4730, SUBINDEX := 1,
              RECORD := UINT_TO_DWORD(i_bico1));
        nStep := 60;
    60: // p4730[2] — Trace 0 DO Id + Chart Id + PIN Id
        WRREC(REQ := TRUE, ID := i_hwId,
              INDEX := 4730, SUBINDEX := 2,
              RECORD := i_dochart0);
        nStep := 70;
    70: // p4730[4] — Trace 1 DO Id + Chart Id + PIN Id
        WRREC(REQ := TRUE, ID := i_hwId,
              INDEX := 4730, SUBINDEX := 4,
              RECORD := i_dochart1);
        nStep := 80;
    80: // p4751[0] — trace control word: bit 0 = start
        WRREC(REQ := TRUE, ID := i_hwId,
              INDEX := 4751, SUBINDEX := 0,
              RECORD := DWORD#16#0001);
        xDone := TRUE;
        nStep := 99;
END_CASE;

IF xError THEN
    wErrId := WORD(tStatus);
    xDone  := FALSE;
END_IF;
END_FUNCTION_BLOCK
Implementation note: In production code, gate each WRREC on the previous block's DONE rising edge and limit concurrent writes to one parameter at a time. Sending overlapping parameter requests to the same DO is the most common cause of intermittent F08501 faults.

Verification Procedure

After the PLC has finished the write sequence, verify the trace is armed and ready to capture:

  1. Read r4752[0] (trace status word). Bit 0 = running, Bit 1 = triggered, Bit 2 = complete. A healthy armed trace shows bit 0 = 1, bits 1 and 2 = 0.
  2. Read back p4730[0] through p4730[5] and confirm they match the values written. Any mismatch indicates the drive rejected the write.
  3. Generate a trigger event (for example, force a step in speed setpoint above p4722) and confirm r4752[0] bit 1 transitions to 1.
  4. After capture completes, read r4760[0..n-1] for sample data. Plot the data against the expected physical behavior.
  5. Cross-check the trace from STARTER: in online mode, STARTER reads back the trace it did not configure and reproduces the captured waveform.

Troubleshooting Matrix

Symptom Drive Fault / Status Likely Cause Remediation
WRREC returns STATUS = 0x80B1 Invalid parameter value BICO connector number is not valid on the target DO Use a STARTER-configured trace to read the working value; copy that connector number exactly
WRREC returns STATUS = 0x80B2 Value out of range Compound DO/Chart/PIN encoding out of range Recompute the compound value; check that chart Id exists in the List Manual for the firmware version
F08501 "Trace: invalid signal source" Trace fault Trace signal references a non-existent connector Reset the trace with p4751[0] = 16#0000, re-write valid p4730[0..5], restart
Trace runs but records zeros No fault Trace armed before BICO source written, or wrong DO Stop trace, write p4730[0..5] first, then p4751[0] = 16#0001
Trace never triggers r4752[0] bit 1 = 0 Trigger threshold or signal wrong Verify p4740[0..5] and p4721, p4722, p4723
Trace captures only part of the event Trace memory truncated p4720 too small or trigger delay wrong Increase p4720 (up to firmware maximum); re-check p4723

Field-Proven Caveats

  • The trace parameter set is per drive object. If you want to trace signals on multiple drive axes, repeat the write sequence against each DO's HW ID. The Control Unit's trace is independent of each Motor Module's trace.
  • The chart Id numbering follows the SINAMICS Function Manual "FH1 — Vector Control / Servo Control" and "FH2 — Communication". Always cross-reference the chart number against the List Manual for the specific firmware version (e.g., V4.8 vs V5.1) — chart numbering is stable but blocks can be added.
  • The trace memory size parameter (p4720) is the number of samples per channel; total memory consumption scales with the number of active channels. On a CU320-2, the practical upper limit is around 8000 samples across 4 channels; going above causes F08502 "Trace: memory overflow".
  • If the application requires recording across multiple drives simultaneously, all traces must be armed within the same scan cycle window. Otherwise, jitter between the controller and the drive's current controller introduces phase error between captures.
  • Use the project-documentation export from STARTER (XML or PDF) to embed the trace configuration in the machine's electrical documentation. Future PLC firmware changes that alter default BICO connector numbers will then be caught at the documentation review stage.

Related Trace Functions and Alternatives

For applications where recording pre-defined parameters is sufficient, the engineer can bypass the BICO encoding entirely by writing only p4730[0] (and the equivalent BICO indices of p4731 – p4737) with the parameter's BICO connector number. This is the simplest PLC-friendly path because every named parameter has a stable BICO connector number on its home DO. Examples:

Trace Signal Parameter BICO Connector
Speed actual value, smoothed r0063 15 (drive axis DO)
Torque setpoint after filter r0079 84 (drive axis DO)
Torque actual value, smoothed r0080 85 (drive axis DO)
DC link voltage r0070 67 (infeed DO)
Output current, smoothed r0078 83 (drive axis DO)

If the trace is configured via SIMATIC-side signal recording (e.g., SIMATIC Trace in TIA Portal), only the SIMATIC CPU tags are available — internal drive variables like r0063 require a BICO source on the SINAMICS side. The TIA Portal trace for the drive object is therefore the recommended alternative when the signals of interest are visible on the PROFINET telegram (drive-internal signals must still be exposed via p4730). See Siemens Support ID 109822276 for the TIA Portal variant.

FAQ

Can the SINAMICS S120 trace be configured entirely from a PLC without STARTER?

Yes — every trace configuration parameter (p4720–p4799) is accessible via acyclic parameter access (WRREC/RDREC over PROFINET or PKW over PROFIBUS). The challenge is not the write access itself but encoding the correct BICO connector for p4730 indices [2]–[5], which require the Drive Object Id, Chart Id (or Block Id), and PIN Id compound value. Read a STARTER-configured trace back first to capture the exact encoding for your firmware version.

What does the value in p4730[2] actually represent?

Index [2] is a 32-bit compound: Drive Object Id (source DO of the signal), Chart Id (function-chart number from the SINAMICS Function Manual), and PIN Id (connector number within that chart). Together they identify a specific connector output that is not otherwise exposed as a named parameter. The exact bit packing is documented in section 11.1.4.5 of the SINAMICS S120 Function Manual.

Why does the trace record zeros even though r4752 shows "running"?

Almost always the BICO source was not written before the trace was armed. The order must be: write p4730[0..5] first, set p4720–p4724, then start the trace with p4751[0] = 16#0001. If the source is empty when the trace starts, the firmware records zero across all channels.

What is the difference between Chart Id and Block Id in p4730?

Both identify a function block in the SINAMICS firmware. Chart Id refers to the diagram number in the Function Manual (e.g., 1700 = setpoint channel). Block Id refers to the named function block (e.g., speed controller, current controller) that exposes its outputs. Use the one that the firmware expects for the signal of interest; both end up in the same compound value but are mutually exclusive within a single index.

Can the same trace configuration be reused across multiple drive axes?

No — the BICO connector numbers and chart references are valid only on the Drive Object that owns them. Trace signals from Drive Axis 1 (DO 3) cannot be applied to Drive Axis 2 (DO 4) without recomputing the connector encoding. Repeat the write sequence per DO, or — when possible — use the symbolic parameter number (r00xx) which the firmware resolves automatically on the addressed DO.

Back to blog