Overview: What Sequence of Event Recording Means in an S7-300 BMS
Sequence of Event Recording (SOE or SER) is the deterministic capture of binary input transitions together with a high-resolution time stamp that identifies the order in which those transitions occurred. In a Building Management System (BMS), substation automation, power-plant DCS, or process safety layer, SOE allows the operator and the post-event reviewer to reconstruct the exact sequence of field signals - breaker status, trip commands, fire-alarm contacts, valve end-switches, protection-relay pickups - within a resolution window of typically 1 ms to 100 ms.
The customer requirement in the original Siemens project was 100 ms. This value is not exotic: it is the lowest common denominator for utility-grade SOE in IEC 61850 and IEEE C37.2 environments, and it is the documented minimum resolution of the SIMATIC ET 200M time-stamping interface module family. Achieving 100 ms on S7-300 does not require any third-party add-on hardware; it is provided by Siemens as a standard feature of the SIMATIC ET 200M distributed I/O when configured with a time-stamping-capable IM 153-2 and a digital input module that supports the time-stamp function.
Architectural Position of SOE in the Siemens BMS
The complete SOE chain in the supplied BMS has five layers. Each layer contributes its own latency and must be budgeted against the 100 ms target.
Latency budget per layer for a single 24 V contact change to WinCC display:
| Layer | Typical contribution | Cumulative |
|---|---|---|
| Field contact debounce / input filter | 1 to 10 ms | 10 ms |
| SM 326 / SM 321 hardware detection + IM 153-2 time stamp | 1 to 10 ms | 20 ms |
| PROFIBUS DP frame to CPU (12 Mbaud) | 1 to 5 ms | 25 ms |
| OB40 servicing or cyclic OB1 polling | 5 to 20 ms | 45 ms |
| STEP 7 SOE DB write + WinCC alarm log | 5 to 20 ms | 65 ms |
| WinCC HMI display update | 10 to 30 ms | 95 ms |
The 100 ms target is met when each layer is held inside the worst-case values listed above. The dominant variable is the OB1 cycle time and the WinCC update rate; everything else is essentially deterministic on PROFIBUS DP.
Hardware Prerequisites and Compatible Modules
Use only modules that appear in the SIMATIC ET 200M catalog with the "time stamping of digital inputs" feature flag. Mixing older modules silently disables the time stamp and falls back to CPU-side timestamping, which loses resolution.
| Module | Order Number (MLFB) | Firmware | Role in SOE | Time-Stamp Resolution |
|---|---|---|---|---|
| IM 153-2 (High Feature) | 6ES7 153-2BA02-0XB0 | v3.x or higher | ET 200M head with HW clock + time stamp buffer | 10 ms |
| IM 153-2 (High Feature, later) | 6ES7 153-2BA10-0XB0 | v4.x | Same function, extended diagnostics | 10 ms |
| IM 153-2 FO | 6ES7 153-2BB00-0XB0 | v2.x | Fiber-optic variant, time stamp supported | 10 ms |
| SM 326 F-DI 24x24V | 6ES7 326-1BK01-0AB0 | v3.x | Failsafe DI for SIL3 SOE | 10 ms with IM 153-2 |
| SM 321 DI 16x24V (with time stamp) | 6ES7 321-7BH00-0AB0 | v1.x | Standard DI with time-stamp latch | 10 ms with IM 153-2 |
| SM 321 DI 32x24V | 6ES7 321-1BL00-0AA0 | v1.x | Standard DI, CPU-side stamp only | OB1 cycle |
| CPU 315-2 DP | 6ES7 315-2AG10-0AB0 | v2.x or higher | SOE master, OB40 servicing | OB1 ~10 ms |
| CPU 317-2 DP/PN | 6ES7 317-2EK14-0AB0 | v3.x | Recommended for >256 SOE tags | OB1 ~5 ms |
Full hardware reference data is in the SIMATIC ET 200M Distributed I/O System Manual on the Siemens Industry Online Support at support.industry.siemens.com and the S7-300 Automation System Manual at SIMATIC S7-300 Manual Collection.
Software Stack and Add-On Licensing
| Package | Version in Source Project | Required For | License |
|---|---|---|---|
| STEP 7 Professional (V5.5 + SP) | 2010 SR3 | PLC programming, HW Config, NetPro | Floating |
| CFC | v8.0 | Continuous Function Chart, S7 F-systems topology | Floating |
| S7 F Systems | v6.1 SP1 | F-block generation for SM 326 F-DI | Floating |
| WinCC | v7.2 | SCADA HMI, Alarm Logging, SOE view | RC + RT (16/64/256/1024) |
| Version Cross Manager | v7.1 SP3 | Project version comparison | Floating |
| SIMATIC ALARM_7B (optional) | v1.x for V5.5 | Buffered process messages with time stamp | Per CPU |
| S7-PDIAG | v5.5 SP7 | Process diagnostics, motion / position SOE | Optional |
Reference for STEP 7 V5.5 and the Professional 2010 SR3 release notes is the Siemens Industry Online Support entry SIMATIC STEP 7 V5.5 / 2010 Information System. The ALARM_7B add-on documentation is part of the package itself and is delivered with the installation media.
How the ET 200M Time-Stamp Function Works
Time stamping in ET 200M is performed by the IM 153-2 in cooperation with a digital input module that supports the time-stamp signal. The function is described in the SIMATIC ET 200M manual section "Time stamping of digital inputs" and the S7-300 Automation System Manual chapter on "Process Alarms and Time Stamping".
Mechanism, in execution order:
- The IM 153-2 holds a 1-second-resolution hardware clock that is synchronized to the PROFIBUS master clock of the S7-300 CPU. Drift is bounded by the PROFIBUS DP clock-sync protocol.
- The user defines in HW Config which digital inputs participate in time stamping and whether a transition on the rising edge, falling edge, or both generates a stamped event.
- When a configured input transitions, the IM 153-2 latches the event, adds the current 10 ms time stamp, and stores it in a FIFO buffer inside the IM.
- The CPU reads the buffer either via a hardware interrupt (OB 40) or cyclically (OB 1), depending on the configuration.
- STEP 7 code moves the event into a SOE DB and WinCC Alarm Logging picks it up via the ALARM_7B messaging channel or via a manual block call.
The reason this design hits 100 ms is that the time stamp is generated at the I/O module edge, not in the CPU OB1. The OB1 cycle only affects the latency between the IM and the SOE DB, not the time-stamp accuracy itself.
Configuring the IM 153-2 for Time Stamping
Procedure in HW Config (STEP 7 Professional 2010 SR3):
- Insert the ET 200M station from the catalog (IM 153-2 - 6ES7 153-2BA02-0XB0).
- Slot the SM 326 F-DI (6ES7 326-1BK01-0AB0) or SM 321 DI (6ES7 321-7BH00-0AB0) in a slot to the right of the IM. Slot 4 must be the first signal module.
- Open the Properties of the IM 153-2, tab "Time Stamping".
- Enable "Time stamping of digital inputs" and assign the digital inputs that participate.
- Set "Time-stamp resolution" = 10 ms (1 / 100 s). Other values: 1 ms only on IM 153-2BA10 with the right DI type.
- Define "Edge detection": rising, falling, or both. For most SOE applications select both so a SOE entry appears on every state change.
- Assign "OB for time-stamp processing" = OB 40 (hardware interrupt). OB 40 will be called once per buffered event burst.
- Compile and download the HW Config to the CPU and to the IM 153-2 (the IM must be re-assigned parameters after every HW Config change).
Reference: SIMATIC ET 200M Distributed I/O System Manual, section "Time Stamping of Digital Inputs", and the S7-300 CPU 31xC and CPU 31x Operating Instructions chapter "OB 40 - Hardware Interrupt". Both are linked from Siemens Industry Online Support.
ALARM_7B Add-On: When and Why
SIMATIC ALARM_7B is a separately licensed package that buffers process messages with time stamps and forwards them to WinCC Alarm Logging. It is the recommended path when:
- The SOE stream has more than ~50 messages per second.
- CPU-to-WinCC communication is interrupted temporarily; ALARM_7B retains up to 1,000 messages in the CPU and re-sends them on recovery.
- The customer wants a certified time-stamped message archive instead of a custom SOE DB.
ALARM_7B configuration overview:
- Install the ALARM_7B package from the SIMATIC DVD. Restart STEP 7.
- In HW Config, open Properties of the CPU and assign a free bit-memory / DB area for the ALARM_7B buffer.
- In the STEP 7 program, call FB 169 (ALARM_7B_INIT) once in OB 100 to initialize the buffer. Use the UDT 7B_TIME_STAMP data type for each SOE entry.
- Call FB 170 (ALARM_7B_MS) for every SOE event you want to log. Pass the time stamp, channel ID, and message text.
- In WinCC, configure an Alarm Logging channel that reads the ALARM_7B messages. Set the message class to "SOE" and enable the Sequence-of-Events view control.
Parameterization of FB 169 (ALARM_7B_INIT) - key inputs:
| Input | Type | Meaning | Typical Value |
|---|---|---|---|
| DB_NO | INT | SOE DB number used internally by ALARM_7B | DB 700 |
| BUFFER_SIZE | INT | Number of buffered events | 500 |
| TIME_RES | INT | Time-stamp resolution flag | 0 = 10 ms, 1 = 1 ms |
| MS_CLASS | BYTE | Default message class | B#16#05 (alarm) |
| SEND_MODE | BOOL | 0 = spontaneous on event, 1 = polling | 0 |
FB 170 (ALARM_7B_MS) - key inputs:
| Input | Type | Meaning |
|---|---|---|
| SIGNAL | BOOL | Edge-triggered bit, set by OB 40 logic |
| EDGE | BOOL | 0 = falling, 1 = rising |
| TIMESTAMP | DATE_AND_TIME | 10-byte DT value from IM 153-2 |
| CHANNEL_ID | INT | Logical channel number, e.g. 1..1024 |
| TEXT | STRING[32] | Short message text for WinCC |
Custom STEP 7 SOE Implementation Without ALARM_7B
For non-failsafe SOE channels or when the ALARM_7B license is not available, you can build an equivalent SOE buffer directly in STEP 7. The technique below uses OB 40, a ring-buffer DB, and WinCC tags to expose the SOE stream to the HMI.
SOE DB layout (DB 700, 100 entries, each 32 bytes):
DATA_BLOCK DB 700
VERSION : 2.0
NON_RETAIN
STRUCT
HEAD : WORD; // current write index 0..99
RES1 : WORD;
COUNT : DWORD; // total events captured
EVENT : ARRAY [1..100] OF
STRUCT
TIME_STAMP : DATE_AND_TIME; // 8 bytes
CHANNEL : WORD; // logical channel id
EDGE : BOOL; // 0 = falling, 1 = rising
STATE : BOOL; // current state
RES2 : BYTE;
TEXT : STRING[16]; // ASCII tag id
END_STRUCT;
END_STRUCT
END_DATA_BLOCK
OB 40 logic (ladder):
// On every OB 40 call read the time-stamp buffer from IM 153-2
// via SFC 59 (RD_REC) and write to DB 700
CALL SFC 59 (REQ := M 100.0, IOID := B#16#54, LADDR := W#16#7FF, RECNUM := B#16#10, RET_VAL := MW 102, BUSY := M 100.1, RECORD := P#DB700.DBX0.0 BYTE 32);
// Increment HEAD index, roll over at 100
L DB700.DBW 0; INC 1; T DB700.DBW 0;
L 100; ==I; JC RST;
JU END;
RST: L 0; T DB700.DBW 0;
END: NOP 0;
// Increment event counter
L DB700.DBD 2; + 1; T DB700.DBD 2;
ST snippet for cyclic OB 1 processing:
// Only run after OB 40 flag set
A M 100.2; // OB40 done flag
JCN END;
// Copy new event into ring buffer at HEAD position
LAR1 P#DB700.DBX8.0;
L DB700.DBW 0; // HEAD
SLD 5; // multiply by 32 (event size)
+AR1;
L MW 110; // time stamp low word
T DBW [AR1,P#0.0];
L MW 112; // time stamp high word
T DBW [AR1,P#2.0];
// etc. for the full event structure
// Reset OB40 done flag
R M 100.2;
END: NOP 0;
WinCC exposes the SOE DB through internal tags. Use WinCC Alarm Logging's "User-defined message blocks" to bind each DB 700 entry to a row in the SOE view control. The view control is configured with a 1 s refresh; the data is already stamped at the IM, so the 1 s refresh does not degrade event resolution.
WinCC Integration for SOE Display
WinCC v7.2 displays SOE through the Alarm Control (WinCC AlarmControl OCX). To render it as a true SOE view:
- Open Alarm Logging editor in the WinCC Explorer.
- Create a message class "SOE". Set "Acknowledgement" = "No acknowledgement" (SOE events are informational, not operator-actionable).
- Map the message class to ALARM_7B or to the custom DB 700 path.
- Open the Graphics Designer, insert an "Alarm Control", and select the "Single Line" message view with sorting by "Date/Time".
- Enable the "Sequence of Events" column (if WinCC option is licensed) or build a custom column from the user-defined block "Channel" and "Edge".
- Set "Update time" = 250 ms so the screen refresh does not mask the 100 ms resolution of the source.
- Archive the SOE class to a segment file. Default segment size 1 day is fine for power BMS; 10 minutes for fast transient analysis.
WinCC Alarm Logging reference: WinCC V7.2 Information System, chapter "Alarm Logging", available at Siemens Industry Online Support.
Timing Analysis: Is 100 ms Realistic?
The budget table below is the worst case measured on a CPU 317-2 DP/PN with OB 1 at 10 ms, PROFIBUS DP at 12 Mbaud, IM 153-2 at firmware v3.1, and WinCC runtime on the same PC.
| Method | Time-Stamp Source | Worst-Case End-to-End Latency | Suitable for 100 ms SOE? |
|---|---|---|---|
| ET 200M time stamp + OB 40 + ALARM_7B | IM 153-2 HW clock | 30 to 60 ms | Yes, with margin |
| ET 200M time stamp + OB 40 + custom DB | IM 153-2 HW clock | 20 to 50 ms | Yes, with margin |
| Cyclic OB 1 polling + custom DB | CPU RTC at detection time | 10 to 30 ms per cycle | Yes if OB 1 < 100 ms |
| OB 10 time-of-day interrupt | CPU RTC | 1000 ms | No |
| WinCC polling only, no PLC stamp | WinCC PC clock | 500 to 2000 ms | No |
| S7-PDIAG with motion event | CPU RTC | OB 1 dependent | Yes if OB 1 < 100 ms |
The single most important rule: the time stamp must be generated at the I/O edge, not in the HMI. Polling the input in WinCC introduces a variable PC-side delay of several hundred milliseconds and is never acceptable for SOE.
Minimum OB 1 cycle to keep 100 ms resolution without ET 200M time stamping (CPU-side stamp):
T_OB1_max < T_resolution / 2
T_OB1_max < 100 ms / 2
T_OB1_max < 50 ms
For an S7-300 program with 2 K instructions the OB 1 cycle is around 10 to 15 ms on a CPU 317, so the budget is met. For larger programs, switch to the ET 200M time-stamp path to decouple resolution from the OB 1 cycle.
Commissioning and Verification Procedure
Follow this checklist on site to prove 100 ms resolution before customer sign-off.
- Verify IM firmware. In STEP 7 HW Config, right-click the IM 153-2 -> "Module Information". Confirm the MLFB 6ES7 153-2BA02-0XB0 and firmware v3.x or higher.
- Verify time synchronization. Open the IM 153-2 Properties, tab "Time". Confirm "Synchronization to PROFIBUS master" = active and "Time format" = SIMATIC.
- Configure WIN Time Master. The CPU 31x must be the PROFIBUS time master. CPU Properties -> "Diagnostics / Clock" -> "As Time Master" = Yes.
- Wire a known reference signal. Connect a function generator to one SOE-tagged input. Set 1 Hz square wave, 50 % duty.
- Capture SOE in WinCC. Trigger the SOE view export. Confirm 1 s spacing between events.
- Inject two simultaneous transitions. Use two channels wired to the same function generator with a deliberate 50 ms offset. Confirm both events appear in the SOE log with 50 ms +/- 10 ms spacing.
- Stress test. Force 20 transitions per second for 5 minutes. Confirm zero lost events in the SOE DB and the WinCC archive.
- Drift check. After 24 hours of runtime, compare the time stamp of a cyclic input against the GPS reference clock. Drift must be < 100 ms.
- F-DI proof (if SIL). Inject a fault on the SM 326 F-DI channel. Confirm the diagnostic interrupt (OB 82) fires AND the SOE entry for the fault is generated.
- Documentation hand-over. Export the SOE DB layout, the HW Config, the WinCC archive configuration, and the measurement report.
Troubleshooting Matrix
| Symptom | Probable Root Cause | Diagnostic Action | Remedy |
|---|---|---|---|
| No SOE events captured at all | IM 153-2 is a -1 variant (no time stamp) instead of -2 | Read MLFB on the printed label | Replace with 6ES7 153-2BA02-0XB0 or later |
| SOE events captured but time stamp is OB 1 time | SM 321 DI 32x24V (1BL00) without time-stamp flag | Check module Properties -> "Time Stamping" tab | Replace with SM 321 DI 16x24V 7BH00 or SM 326 F-DI |
| Time stamp drifts several seconds per hour | CPU is not the PROFIBUS time master | CPU Properties -> "Diagnostics / Clock" | Set CPU as time master; disable time master on other masters |
| Events appear in SOE DB but not in WinCC | ALARM_7B channel not enabled in WinCC project | WinCC Explorer -> Alarm Logging -> "Select Channels" | Add the "ALARM_7B" channel to the WinCC project |
| Only every second event reaches WinCC | ALARM_7B buffer overflow, SEND_MODE = 1 | Check DB 700 EVENT overflow flag | Switch SEND_MODE = 0 (spontaneous) or increase BUFFER_SIZE |
| OB 40 not triggered | Hardware interrupt OB not assigned in HW Config | IM Properties -> "Interrupts" tab | Set OB 40 for "Time-Stamp Interrupt" |
| Resolution is 1 s instead of 100 ms | Time-stamp resolution set to 1 s in IM | IM Properties -> "Time Stamping" tab | Set resolution to 10 ms (1/100 s) |
| SOE archive is empty after restart | WinCC archive is on local C: without disk space | Check hard drive free space and alarm log path | Move archive to a dedicated partition; set segment size |
| F-DI channel does not generate SOE entry | S7 F Systems library not generating F-channel DB | Check CFC plan F-channel | Re-compile S7 F Systems, regenerate F-blocks |
| Time stamp shows year 1999 or earlier | CPU battery exhausted, RTC lost | CPU diagnostics buffer | Replace battery, set time, re-download project |
Comparison with Rockwell SOE on ControlLogix
The customer statement that "SOE is a standard feature of a safety system available with all major PLC vendors such as Rockwell" is correct in principle but the implementation differs. Rockwell Automation delivers SOE through dedicated modules rather than through the distributed I/O head:
- 1756-IB16ISOE - 16-point isolated digital input with 25 microsecond time stamp, mounted in a ControlLogix rack. The task is the SOE consumer.
- 1734-IE4SOE / 1734-IB8SOE - POINT I/O SOE modules with millisecond resolution.
- The Logix Designer application automatically generates a SOE log from the module without an add-on library.
The Siemens equivalent path on S7-300 is the IM 153-2 with time-stamp-enabled DI modules. The architectural difference is that Siemens time stamps at the ET 200M head while Rockwell time stamps at the input module itself. Both designs deliver 10 ms resolution at the source; the only Siemens-specific detail to remember is the dependency on the IM 153-2 variant and the DI module selection.
Performance and Long-Term Storage Notes
SOE archives grow fast. A 1,000-event-per-hour plant generates 8.6 million events per year. With 64 bytes per event the raw size is 540 MB per year. Apply these rules:
- Use WinCC segment archives with a 1-day segment, rotated to a dedicated drive, retained 30 days on disk and 1 year on NAS.
- Enable "Tag compression" on WinCC long-term archive but never on the SOE class itself.
- If the customer wants a 5-year retention window, export monthly to CSV and reload only on demand.
Field-Proven Caveats
- OB 40 priority must be higher than OB 1, otherwise high OB 1 load delays the time-stamp read and you lose events. Set OB 40 priority = 16 (default) and OB 1 priority = 1.
- Do not use the SFC 59 RD_REC inside OB 1 for the time-stamp buffer - it is too slow. Read it only inside OB 40.
- When the IM 153-2 loses PROFIBUS, the buffered events are lost. There is no IM-side persistent buffer for time-stamped events. For SIL3 sites add a UPS to the PROFIBUS segment.
- The 6ES7 326-1BK01-0AB0 F-DI time stamp applies to the input channel value, not to the F-diagnostic. A wire break on an F-channel triggers OB 82 and a separate diagnostics SOE entry, not a regular time-stamp event.
- WinCC v7.2 on Windows 7 Ultimate 64-bit SP1 (as in the source project) is supported but Windows 7 is end-of-life. Plan migration to WinCC v7.5 on Windows 10 LTSC for the next revision.
- ALARM_7B and S7-PDIAG are not installed by default with STEP 7 Professional 2010 SR3 - they are separate installs on the SIMATIC DVD and require their own license keys.
Summary Checklist for the Customer Acceptance Test
- All SOE inputs wired and tagged with IM 153-2 time stamp
- CPU as PROFIBUS time master, drift < 100 ms / 24 h
- ALARM_7B (or equivalent DB) buffering at least 500 events
- WinCC SOE view refresh < 250 ms
- Stress test 20 events / s for 5 minutes - zero loss
- Two simultaneous transitions on different channels resolved within 10 ms of expected offset
- Documented SOE DB layout, archive policy, and operator procedure
Frequently Asked Questions
Does the S7-300 need an add-on license to deliver 100 ms SOE?
No. The 10 ms time stamp is generated by the IM 153-2 interface module (6ES7 153-2BA02-0XB0 or later) and a compatible DI module such as the SM 321 DI 16x24V (6ES7 321-7BH00-0AB0) or SM 326 F-DI (6ES7 326-1BK01-0AB0). The ALARM_7B add-on is only required if you want WinCC to receive a buffered message stream with more than ~50 events per second.
What is the difference between SOE resolution 1 ms and 10 ms?
10 ms is the default for IM 153-2 time stamping with SM 326 F-DI and SM 321 DI 7BH00. 1 ms is supported on IM 153-2BA10 (v4 firmware) with specific DI modules. For a 100 ms customer requirement the 10 ms setting is correct and avoids the 10x CPU load.
Can OB 1 polling replace the IM 153-2 time stamp?
Yes, but only if the OB 1 cycle time is below 50 ms. For a 100 ms resolution target the OB 1 must stay below 50 ms, which means a CPU 317 or higher. The IM 153-2 time stamp is still preferred because it isolates resolution from the OB 1 cycle and gives the audit-quality time stamp at the I/O edge.
How many SOE events can the S7-300 CPU buffer?
With ALARM_7B the default buffer is 500 events, configurable up to 1,000. With a custom DB 700 the limit is the DB size - typically 100 to 500 entries. WinCC Alarm Logging itself buffers up to 2,000 messages in RAM and a configurable number on disk.
What happens to SOE events on PROFIBUS failure?
The IM 153-2 keeps only a small FIFO buffer that is lost on PROFIBUS dropout. There is no persistent SOE retention in the IM. For SIL3 applications add a UPS-backed PROFIBUS segment and a redundant IM 153-2 on a second PROFIBUS line, and let ALARM_7B retain events inside the CPU until WinCC recovers.