Overview of S7-1500 Organization Block Architecture
Organization Blocks (OBs) form the interface between the S7-1500 CPU operating system and the user program. The operating system calls OBs on the occurrence of defined events: cyclic execution, time-of-day events, hardware interrupts, startup, errors, communication, and motion control triggers. Unlike S7-300/400 where the OB model is dominated by the older priority-26/27/28 class structure, the S7-1500 uses an optimized OB model with a wider priority range, hardware-accelerated execution, and significantly improved start information.
For an S7-1500 program to run, only OB1 (cyclic main program) is strictly required. The TIA Portal automatically creates OB1 when a new S7-1500 device is added. All other OBs are optional and are added only when the program must react to a specific event class, handle a fault, run a safety program, or drive a motion control technology object. This is a deliberate departure from the S7-400F/F-CPU practice of always inserting OB40, OB80, OB82, OB86, and OB121.
For the official Siemens reference, see Events and OBs (S7-1500) - STEP 7 V14.0 and the current TIA Portal V20 functional description: Events and OBs (S7-1500) - TIA Portal V20.
OB Categories on S7-1500
S7-1500 OBs are grouped into the following functional categories. Each category uses a fixed numerical range that must not be violated:
| Category | OB Range | Trigger | Mandatory? |
|---|---|---|---|
| Program cycle | OB 1 | Cyclic main scan (monitored) | Yes (auto-created) |
| Startup | OB 100, 101, 102 | Restart, warm restart, hot restart | No |
| Time-of-day | OB 10-17 | Configured date/time | No |
| Time-delay | OB 20-23 | After SRT_DT / SRT_DINT call | No |
| Cyclic interrupt | OB 30-38 | Fixed interval (ms) | No |
| Hardware interrupt | OB 40-47 | DI/DO edge, submodule event | No |
| Status / error | OB 55-57, 70-87, 121-122 | Diagnostic, communication, fault | No (but recommended) |
| Motion Control | OB 91, 92 | Servo, Interpolator | Auto-assigned by TO |
| Safety (F-CPU) | FOB_RTG1 (default) | F-runtime cyclic | Auto-created with F-CPU |
| Isochronous / PROFINET | OB 61-64, 65-68 | PROFINET IRT, isochronous | No |
Priorities and Parallel Execution
S7-1500 supports a 26-level priority scheme (0-25) per OB. OB priority is configured in the OB properties dialog in TIA Portal. Higher-priority OBs interrupt lower-priority OBs; identical priorities are queued in time order of arrival. The cyclic OB1 is the lowest priority in the standard scheme (priority class 1), but TIA Portal typically assigns OB 1 to priority class 1 for the main program.
| OB Type | Default Priority | Configurable Range |
|---|---|---|
| OB 1 (program cycle) | 1 | 1-26 |
| OB 10-17 (time-of-day) | 2 | 2-24 |
| OB 20-23 (time-delay) | 3 | 2-24 |
| OB 30-38 (cyclic interrupt) | 7-15 (by OB number) | 2-24 |
| OB 40-47 (hardware interrupt) | 16-23 (by OB number) | 2-26 |
| OB 55-57 (status) | 9 | 2-24 |
| OB 80 (time fault) | 26 | 2-26 |
| OB 82 (diagnostic interrupt) | 9 | 2-24 |
| OB 83 (insert/remove) | 9 | 2-24 |
| OB 85 (program execution) | 9 | 2-24 |
| OB 86 (rack/station failure) | 9 | 2-24 |
| OB 91, 92 (motion) | 25 / 24 | Auto-managed |
| OB 121, 122 (programming error) | Priority of calling OB | Inherits |
The detailed priority matrix per OB number and start event is given in the official Siemens entry 109742272.
Cyclic Program Execution: OB 1
OB 1 is the only OB the S7-1500 absolutely requires. The CPU executes it in a fixed, monitored cycle. The minimum cycle time and the scan time monitoring limit are configured in PLC properties > Cycle. When OB 1 completes, the operating system re-triggers it after the configured minimum cycle time has elapsed (or immediately if no minimum is set). If the maximum cycle time is exceeded, OB 80 is called (if present) or the CPU goes to STOP.
OB 1 must not be deleted from an S7-1500 project. If it is missing, the CPU stops with a startup error.
Startup OBs (OB 100, OB 101, OB 102)
The S7-1500 supports three startup OBs, matching the type of restart the CPU performs:
| OB | Startup Type | Use Case |
|---|---|---|
| OB 100 | Complete restart (cold restart) | Power on, mode selector RUN after STOP, restart from PG |
| OB 101 | Warm restart (firmware dependent) | Available on specific CPU firmware; generally not used on S7-1500 |
| OB 102 | Hot restart | Available on CPU 1518 and firmware 2.0+; retains all data |
Startup OBs run once at the end of startup before OB 1 begins. Typical use: initialize process tags, set outputs to a safe state, synchronize drive parameters. S7-1500 CPUs do not differentiate RUN-STOP-RUN the same way S7-400 does; a STOP-to-RUN transition performs a complete restart (OB 100).
Time-of-Day Interrupts (OB 10-17)
OB 10 through OB 17 are triggered at a configured date and time, or at a recurring interval (every minute, hourly, daily, weekly, monthly, yearly, end of month). The S7-1500 supports up to 8 time-of-day OBs. The start time and periodicity are set either in the OB properties or in runtime via SET_TINT / ACT_TINT / CAN_TINT.
Typical use: shift log generation, scheduled recipe download, daily reset of counters, time-stamped batch transitions.
Time-Delay Interrupts (OB 20-23)
OB 20-OB 23 are started by a user call to SRT_DINT (set time-delay interrupt). The OB runs after a programmed delay (DT format) and only once per call. Use when a specific action is required a defined time after an event: shutdown cool-down timers, post-stop monitoring windows, debounce logic.
Cyclic Interrupts (OB 30-38)
OB 30-OB 38 are triggered on a fixed time base. The S7-1500 supports base intervals from 500 µs (OB 30) up to 60000 ms (OB 38), with finer steps in between. They run independently of OB 1 and are used for:
- Closed-loop control loops with deterministic execution period (PID_Compact, PID_3Step, technology objects)
- High-speed I/O sampling independent of OB 1 scan
- Isochronous application classes paired with PROFINET IRT
The actual phase offset between OB 1 and the cyclic interrupt is set on the OB's Properties > Cycle Time page; the CPU then starts the OB aligned to the configured time grid.
Hardware Interrupts (OB 40-OB 47)
OB 40 through OB 47 respond to hardware events on digital inputs, digital outputs, or submodule diagnostics. Up to 8 hardware-interrupt OBs are available. The interrupt is assigned in the I/O tag properties (e.g., on a DI module: "Hardware interrupt" enabled, OB 40 selected, rising or falling edge chosen). Typical use: fast reaction to a limit switch, capture/compare event, or a counter overflow on TM/Count modules.
Diagnostic and Error OBs (OB 70-OB 87, OB 121, OB 122)
The S7-1500 error OBs differ from S7-300/400 in two important ways: (1) the CPU does not STOP on a missing error OB by default - it logs the event and continues; (2) OB 121 / OB 122 are used to mask programming or I/O access errors locally rather than globally. The error OBs and their triggers are:
| OB | Trigger | Default Reaction if Absent |
|---|---|---|
| OB 70 | I/O redundancy error (H-system) | Ignored |
| OB 72 | CPU redundancy error (H-system) | Ignored |
| OB 73 | Communication redundancy error | Ignored |
| OB 80 | Time fault (cycle overflow, OB not yet finished) | CPU STOP if cycle exceeded twice |
| OB 81 | Power supply fault | Ignored |
| OB 82 | Diagnostic interrupt (channel / module diagnostic) | Ignored |
| OB 83 | Module insert/remove (during RUN) | Ignored |
| OB 84 | CPU/IM hardware fault (centralized) | Ignored |
| OB 85 | Program execution error (e.g., OB not loaded) | CPU STOP |
| OB 86 | Rack / station / IO device failure (PROFINET) | Ignored |
| OB 87 | Communication error (PG/OP/HMI connection lost) | Ignored |
| OB 121 | Programming error (e.g., BCD conversion, range, type) | CPU STOP at priority of failed OB |
| OB 122 | I/O access error (missing / faulty module) | CPU STOP at priority of failed OB |
Field practice: OB 80, OB 82, OB 85, OB 86, OB 121, and OB 122 are the most commonly inserted error OBs. They should at minimum log the event to a data block (with timestamp from the OB's start info) and clear the diagnostic buffer flag, so that transient errors do not cause nuisance STOPs. The start information for each of these OBs is documented in the OB start information (S7-1500) - TIA Portal V20 reference.
Safety OBs on F-CPUs (FOB_RTG1, FOB_RTG2)
When an S7-1500F CPU is configured (e.g., CPU 1510SP F, CPU 1515F, CPU 1518F), the F-runtime group OBs are created automatically and the F-program runs separately from the standard program. The default FOB is named FOB_RTG1 with a fixed execution interval (typically 100 ms; configurable per F-runtime group). The S7-1500F supports two F-runtime groups: FOB_RTG1 and FOB_RTG2 when the optional second F-runtime group is enabled in the safety administration editor.
The FOB is not added manually; it is generated by the F-CPU block container with its associated F-runtime group DB. The FOB priority is 25 (above most standard OBs) so that the safety program preempts standard code with a deterministic deadline.
Motion Control OBs (OB 91, OB 92)
STEP 7 automatically assigns OB 91 (MC-Servo) and OB 92 (MC-Interpolator) to the motion control runtime as soon as a motion technology object (TO) is added under Technology objects > Motion Control. The two OBs handle:
- OB 91 (Servo): the closed-loop position control cycle, executed at the configured servo cycle (typically 1 ms; 250 µs on high-end CPUs).
- OB 92 (Interpolator): the path interpolation and setpoint generation cycle.
These OBs must not be added or modified manually. The cycle, priority, and assignment are managed by the motion configuration in the T0 properties (Motion Control > Configuration > Servo / Interpolator). The CPU firmware reserves OB 91/92 and rejects the addition of other OBs with those numbers.
OB Start Information Structure
Each OB has a fixed-length start information block. In S7-1500, the start info is provided as a typed in-out parameter (Temp) on the OB interface, generated automatically by TIA Portal when the OB is created. Unlike S7-300/400 where the start info is read from fixed-byte local data (e.g., LB12, LB13), S7-1500 start info tags are named and typed.
Example for OB 82 (Diagnostic Interrupt):
| Tag Name | Type | Meaning |
|---|---|---|
| IO_state | WORD | Input/output state at time of event |
| Channel | UINT | Channel number (0 = whole module) |
| Mult_fault | BOOL | TRUE if more faults queued |
| Slot_No | UINT | Module slot |
| IO_Type | BYTE | 0=input, 1=output, 2=submodule |
| Event | BYTE | 0=incoming, 1=outgoing |
| HwInterface | HW_IO | Hardware identifier of the module |
| FaultId | DWORD | Channel diagnostic ID |
The full set of start info tags for every OB is in the TIA Portal V20 OB start information reference.
Adding OBs in TIA Portal
- Open the project in TIA Portal V18 / V19 / V20.
- In the project tree, expand PLC_x > Program blocks.
- Double-click Add new block.
- Select the Organization block tab; the dialog shows all OBs available for the current CPU type and firmware version.
- Choose the OB (e.g., OB 82 - DiagnosticInterrupt), assign a number (1-32767 in S7-1500, except reserved numbers), name, and language (LAD, FBD, STL, SCL, GRAPH).
- Set priority, cycle time (for cyclic / time OBs), and phase offset in the OB's Properties.
- Compile and download the hardware and software to the CPU.
Comparison with S7-300/S7-400 OB Practice
| Aspect | S7-300/400 | S7-1500 |
|---|---|---|
| Mandatory OBs | OB 1 + typical fault OBs recommended (OB 80-87, 121, 122) | OB 1 only; all other OBs optional |
| Default reaction to missing error OB | CPU STOP | CPU logs and continues for most error OBs; OB 80 and OB 85 still STOP the CPU |
| Safety F-OB | OB 35/OB 10 fixed for F-program on S7-400F | FOB_RTG1 (FOB_RTG2 optional), priority 25, auto-created |
| Motion OBs | None standardized; user-defined OB 3x | OB 91 / OB 92 reserved and auto-managed |
| Start information access | Local data bytes (LBn, LWn) | Named typed tags on OB interface |
| OB priority range | 1-27 (S7-400) / 1-26 (S7-300) | 1-26 (object-level priority) |
| Number of cyclic interrupts | OB 30-38 (9 available) | OB 30-38 (9 available, 500 µs minimum on OB 30) |
Field-Recommended OB Set for a Standard S7-1500 Application
For a non-redundant, non-safety, non-motion application (e.g., a small skid with PROFINET I/O and an HMI), the following OB set is sufficient and recommended as a baseline:
- OB 1 - cyclic main program (mandatory, auto-created)
- OB 100 - complete restart (initialize process tags, set outputs to safe state)
- OB 80 - time fault (cycle overrun handler; log and continue if possible)
- OB 82 - diagnostic interrupt (catch module/channel diagnostics from PROFINET devices)
- OB 83 - plug/pull in RUN (only if hot-swap is required)
- OB 85 - program execution error (catch missing OBs at runtime)
- OB 86 - rack/IO device failure (PROFINET node loss)
- OB 121 - programming error (avoid nuisance STOPs on bad conversion or array bound)
- OB 122 - I/O access error (avoid STOPs on missing or failed module reads)
Do not insert OB 40 through OB 47 unless you have explicitly assigned hardware interrupts in the device configuration. Unused hardware-interrupt OBs at default priority can preempt the main program with no logic to run.
Sample SCL Snippet: Error OB Logging
The following SCL code inside OB 82 (DiagnosticInterrupt) writes the diagnostic event to a global data block and acks the diagnostic, so the same event does not re-trigger the OB in a tight loop:
// OB 82 - Diagnostic Interrupt (SCL)
#iobState := 0; // input at time of event
#iChannel := 0; // channel
#bMultFault := FALSE; // more faults pending
#iSlot := 0; // slot number
#byIOType := 0; // 0=in, 1=out, 2=sub
#byEvent := 0; // 0=incoming, 1=outgoing
#hwIf := 0; // HW identifier
#dwFaultId := 0; // channel diagnostic ID
// Placeholder: copy to global log DB
globDiagLog[DIA_LAST_IDX].IO_state := #iobState;
globDiagLog[DIA_LAST_IDX].Channel := #iChannel;
globDiagLog[DIA_LAST_IDX].Mult_fault := #bMultFault;
globDiagLog[DIA_LAST_IDX].Slot_No := #iSlot;
globDiagLog[DIA_LAST_IDX].IO_Type := #byIOType;
globDiagLog[DIA_LAST_IDX].Event := #byEvent;
globDiagLog[DIA_LAST_IDX].HwIf := #hwIf;
globDiagLog[DIA_LAST_IDX].FaultId := #dwFaultId;
globDiagLog[DIA_LAST_IDX].Timestamp := RD_SYS_T;
DIA_LAST_IDX := DIA_LAST_IDX + 1;
IF DIA_LAST_IDX > DIA_LOG_LEN THEN DIA_LAST_IDX := 1; END_IF;
Troubleshooting Matrix
| Symptom in Diagnostic Buffer | Likely Missing OB | Recommended Action |
|---|---|---|
| "Cycle time exceeded" followed by STOP | OB 80 | Insert OB 80; raise maximum cycle time, or reduce scan load |
| STOP on "Priority class error" | OB 85 | Insert OB 85; the OB that was supposed to handle an event is not loaded |
| STOP on "Programming error" | OB 121 | Insert OB 121; fix the illegal operation flagged in the buffer |
| STOP on "I/O access error" | OB 122 | Insert OB 122; verify module presence and slot configuration |
| PROFINET device loss not detected by user code | OB 86 | Insert OB 86; use start info to identify lost device |
| Module diagnostic event not reflected in HMI | OB 82 | Insert OB 82; copy RDREC output to a global tag |
| Safety program does not run | FOB_RTG1 missing | Add F-CPU to device configuration; safety FOB is generated automatically |
| Motion TO does not move axis | OB 91 / OB 92 conflict | Remove user-added OB 91/92; let Motion Control auto-assign them |
Best Practices
- Always keep OB 1 - it cannot be deleted without stopping the CPU.
- Insert at least OB 80, OB 85, OB 121, OB 122 to prevent nuisance STOPs on transient errors. Without them, a single bad read can halt the line.
- Keep OB 82, OB 86 active on any system with PROFINET IO so that the PLC records device-level diagnostics to a global log.
- Do not insert hardware-interrupt OBs (OB 40-47) unless I/O tags are explicitly bound to them. Leaving them at default priority and empty wastes scan time.
- Do not manually create OB 91 / OB 92; the Motion Control add-in reserves and manages them. If a manual OB 91/92 exists, the Motion Control configuration refuses to compile.
- Do not call F-blocks from standard OBs. The F-compiler rejects cross-calls; the safety program runs only from FOB_RTG1 / FOB_RTG2.
- Use the named start-information tags of the OB interface (e.g.,
Slot_No,HwInterface) instead of fixed local-data bytes - this is the supported S7-1500 pattern. - Set OB priorities to match the real-time class: motion 25, hardware 16-23, cyclic 7-15, time-of-day 2. Changing OB 1 priority to something high can break OB 80 / 121 / 122 inheritance.
- For S7-1500F, do not delete or rename FOB_RTG1; the F-administration editor manages it. To change the cycle, edit the F-runtime group properties, not the FOB itself.
Which OBs are mandatory on an S7-1500 PLC?
Only OB 1 is mandatory. TIA Portal creates it automatically when you add a new S7-1500 device. All other OBs (startup, time-of-day, hardware interrupt, error, motion, safety) are optional and are added only when the program must react to that event class.
Do I need to add OB 40, OB 80, OB 82, OB 86, OB 121 as I did on S7-400?
Not by default. On S7-1500, missing error OBs do not cause an immediate STOP for most events - the CPU logs the event and continues. Insert OB 80, OB 85, OB 121, and OB 122 to keep the CPU running through transient programming or cycle errors. OB 82 and OB 86 are recommended for PROFINET diagnostics handling.
What is FOB_RTG1 and when is it created?
FOB_RTG1 is the safety organization block for the first F-runtime group on an S7-1500F CPU. It is created automatically when you add an F-CPU to the device configuration, with priority 25 and a default 100 ms cycle (configurable). FOB_RTG2 is added when a second F-runtime group is enabled.
Why are OB 91 and OB 92 reserved?
OB 91 (MC-Servo) and OB 92 (MC-Interpolator) are reserved for the Motion Control runtime. TIA Portal auto-assigns them as soon as a motion technology object is added. Creating them manually prevents the motion configuration from compiling, and the CPU rejects the program in the download.
How do I read OB start information on S7-1500?
Use the named typed tags on the OB's interface (Temp section) - for example, HwInterface, Channel, FaultId, Event in OB 82. The local-data byte method (LB12/LB13) used on S7-300/400 is not supported on S7-1500; the operating system does not populate fixed local-data bytes for OBs.
What happens if the S7-1500 CPU hits a programming error and OB 121 is missing?
The CPU goes to STOP at the priority class of the OB that triggered the error. Inserting OB 121 lets the program continue and lets you log the error to a global DB. The start info of OB 121 contains BlockNum, FaultAddress, and FaultMode for diagnosis.