Resolving S5-115U to S7-300 Conversion Error: RS 100 OB10 Timing

David Krause16 min read
S7-300SiemensTroubleshooting
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

Problem Overview

When converting an S5-115U program (typically CPU 944B or CPU 945) to S7-300/400 using the STEP 7 "S5 to S7 Converter" or the integrated conversion wizard, engineers frequently hit an Invalid operator error inside blocks such as FB 220. The error references STL statements of the form:

:L KF 120;
:T RS 100;

The converter reports a line-level error such as:

*** Error in Line 1639 (FB 220): Invalid operator. ***

This error blocks the conversion of the affected block. The root cause is the architectural difference between S5-115U and S7-300/400: the S5-115U uses runtime-modifiable system data words to set the execution interval of time-driven organisation blocks (OB 10), while S7-300/400 schedules cyclic interrupts exclusively through hardware configuration (HW Config) or the TIA Portal device editor. The S5 to S7 converter cannot translate an instruction whose target operand does not exist in the S7 memory model.

This article documents the system data layout of the S5-115U CPU 944B, the OB mapping rules from S5 to S7-300, the exact code edits required to clear the converter error, and the HW Config parameters that replace the deleted S5 writes.

S5-115U System Data Region (RS/BS) and OB Scheduling

The S5-115U PLC family reserves a fixed range of word addresses for system data. These addresses are not standard flag (M/F), input (I/E), output (Q/A), or data (DB/D) areas; they are system flag words whose values are read or written by the operating system to control PLC behaviour.

Area Mnemonic Function
RS System flags (R-System) Volatile system data, re-initialised on restart
BS Battery-backed system flags (B-System) Retained system data, survives power cycle
AS Absolute system flags Reserved for system use

The RS area is volatile; the BS area is backed by the CPU battery. Both are part of the S5-115U system program and are not allocated to user data. In the S5-115U manual (CPU 941 to CPU 944), the system data layout is documented on page 6-13, Table 6.3. The relevant addresses for OB 10 cyclic interrupt timing are:

Address Meaning
RS 96 Real-time clock: hours (BCD)
RS 97 Real-time clock: minutes/seconds (BCD)
RS 98 Date (BCD)
RS 99 Status bits
RS 100 OB 10 time base (interval in ms)
RS 101 OB 11 time base (interval in ms)
RS 102 OB 12 time base (interval in ms)
RS 103 OB 13 time base (interval in ms)
BS 100 - BS 103 Retained counterparts of the above

A common S5-115U pattern is to set OB 10's execution interval from the program at startup:

:L KF 120;     // Load fixed constant 120
:T RS 100;     // Transfer to RS 100 (time base in ms)

The instruction :L KF 120; loads a 16-bit fixed-point constant (KF = Konstante Festpunkt) with the value 120. The instruction :T RS 100; writes that value to the system flag word at address RS 100. The S5-115U operating system reads RS 100 on every cycle and triggers OB 10 according to the interval configured there. The same pattern is also written as :T BS 100; for the battery-backed variant, depending on the program author's preference for retention.

Architectural Difference: S5 Runtime System Variables vs S7 Hardware Configuration

The S7-300/400 family removed the concept of user-modifiable system flag words. Cyclic interrupt OBs (OB 30 through OB 38) and time-of-day interrupt OBs (OB 10 through OB 17) are scheduled entirely by the configuration in HW Config (STEP 7 V5.x) or in the device configuration of TIA Portal. The configuration is downloaded with the hardware configuration and cannot be modified from the user program at runtime.

Aspect S5-115U S7-300/400
OB 10 trigger System flag RS 100 (program writes) Configuration in HW Config (fixed at compile/download)
OB cycle change at runtime Yes (write RS 100 from FB/OB) No (requires re-download of configuration)
Time-of-day interrupt OB OB 10 (cyclic in S5 terminology) OB 10 - OB 17 (time-of-day), OB 30 - OB 38 (cyclic)
Configuration tool None (programmatic) HW Config / TIA Portal device editor
System flags writable by user Yes (RS/BS area) No (no RS/BS area exists)

Because S7-300/400 has no equivalent of RS 100, the S5 to S7 converter cannot translate :T RS 100;. It emits Invalid operator because the target S7 instruction set does not include an operator that writes to a system flag word. The same error occurs for :T BS 100;, :L RS 100;, :L BS 100;, and any other reference to the RS or BS area. The full list of conversion error messages, their meaning, and remedies is documented in the Siemens STEP 7 From S5 to S7 reference manual.

S5-115U OB to S7-300 OB Mapping Reference Table

For a CPU 944B-based S5-115U program, the most common OBs and their S7-300/400 equivalents are:

S5-115U OB Function S7-300/400 Equivalent Notes
OB 1 Main cyclic program OB 1 Direct mapping, no code change
OB 2 Interrupt-driven OB 40 Hardware interrupt
OB 3 Battery fault OB 81 Diagnostic
OB 4 I/O fault OB 82, OB 85, OB 122 Diagnostic
OB 10 Cyclic interrupt (RS 100 sets interval) OB 30 - OB 38 Choose one; configure interval in HW Config
OB 11 - OB 13 Cyclic interrupts (RS 101-103) OB 30 - OB 38 Map by function, not by number
OB 20 Time-of-day interrupt OB 10 - OB 17 Time-of-day in S7
OB 21 Restart (warm restart) OB 100 S5 OB 21 = S7 OB 100 warm restart
OB 22 Cold restart OB 101 Manual cold restart on S7
OB 31 - OB 34 I/O fault OBs OB 82, OB 85, OB 122 Map by fault type

The source program in the typical case mixes OB 10 (cyclic, interval set via RS 100) and OB 21 (restart). The conversion tool maps OB 21 to OB 101 by default; the engineer moves the startup code to OB 100 to obtain a warm restart, which is the more common S7 behaviour for a CPU 315-2 or CPU 314.

Resolving the "Invalid Operator" Conversion Error in FB 220

To clear the Invalid operator error in FB 220, the engineer must remove the offending lines. Two approaches are valid:

  1. Edit the S5 source before conversion (preferred): comment out or delete the lines in the S5 source, then re-run the converter. This prevents the converter from attempting to translate an unsupported operator and produces a clean S7 FB.
  2. Edit the converted S7 source after conversion: delete the failed lines from the S7 STL source, then re-compile. This works for blocks that have already been partially converted.

Step-by-step (S5 source edit):

  1. Open the S5 source file (typically .S5D or the S5 program file container) in the S5 Editor or in STEP 7 after attaching the S5 file.
  2. Locate FB 220 in the source. Find the segment containing:
    :L KF 120;
    :T RS 100;
    
  3. Insert STL comment characters (semicolon ;) in front of each line, or delete the lines entirely.
  4. Save the S5 source.
  5. Re-run the S5 to S7 converter (Tools → S5 to S7 Converter, or the wizard in STEP 7 V5.x).
  6. Verify that no Invalid operator errors remain in the conversion log.

Step-by-step (S7 source edit, post-conversion):

  1. Open the S7 project in SIMATIC Manager.
  2. Open FB 220 in the S7 program (Sources → FB220).
  3. Navigate to line 1639.
  4. Delete the L 120; line and the commented // T BS 100; line.
  5. Save and compile (Ctrl+B).

The block will then compile cleanly. The conversion log should show no further errors for FB 220.

Note: Do not leave the S5 RS/BS writes as commented lines in the S7 source. Although STEP 7 will accept the comments, the runtime has no use for them and they obscure the converted logic. Delete them outright.

HW Config and TIA Portal OB Configuration Procedure

After conversion, the cyclic interval for the chosen S7 OB must be set in HW Config or TIA Portal. The S5 instruction pair T RS 100; L KF 120; configured OB 10 to run every 120 ms. In S7-300, the equivalent is OB 35 (or any OB 30 - OB 38) configured with a 120 ms cycle.

STEP 7 V5.x (HW Config)

  1. Open HW Config for the S7-300 station.
  2. Select the CPU (for example, 6ES7 314-6CG03-0AB0 or 6ES7 315-2EH14-0AB0).
  3. Open the CPU properties dialog (double-click the CPU).
  4. Navigate to the Cyclic Interrupts tab.
  5. Set the parameters for OB 35 (or the OB number you choose):
    Parameter Value
    OB OB 35
    Priority 12 (default)
    Phase offset 0 ms (default)
    Cycle time 120 ms
  6. Click OK and save/compile the hardware configuration (Station → Save and Compile).
  7. Download the hardware configuration to the CPU (target system download).

TIA Portal (V13 and later)

  1. Open the project in TIA Portal.
  2. Open Devices & Networks from the project tree.
  3. Double-click the CPU in the device view.
  4. In the CPU properties inspector, select Cyclic interrupts.
  5. For OB 35 (or the chosen OB 30 - OB 38), set the cycle time to 120 ms and leave the phase offset at default.
  6. Compile the project and download the hardware configuration.

If OB 35 is not present in the S7 program blocks folder, the CPU will not call it; the cyclic interrupt remains disabled. Ensure the converted OB 35 source is downloaded alongside the rest of the program. The S5 to S7 converter places the original OB 10 code into the target OB during conversion; verify the file is present in Blocks in the S7 program.

Source Code Translation: L KF 120; T RS 100

The S5-115U code:

:L KF 120;
:T RS 100;

translates conceptually to a hardware configuration parameter, not an S7 instruction. The S7 equivalent is not a code line but a project setting.

S5 Instruction S5 Effect S7 Equivalent
L KF 120 Load constant 120 (interval in ms) HW Config: OB 35 cycle = 120 ms
T RS 100 Write to system flag RS 100 No equivalent; configure in HW Config

If the S5 program was setting OB 10's interval dynamically from the program (for example, based on process conditions or operator input), the S7 equivalent is a different pattern. The engineer must:

  1. Read the desired interval from a data block or input (for example, DB100.DBW0 or IW0).
  2. Use the SFC (system function) interface to change the OB cycle at runtime.

In S7-300/400, OB 30 - OB 38 cycle times are fixed at download. To change them at runtime, the engineer can:

  • Use SFC 26 (UPDAT_PI) and SFC 27 (UPDAT_PO) to update process image sections.
  • Use SFC 28 (SET_TINT) and SFC 29 (CAN_TINT) for time-of-day interrupts (OB 10 - OB 17).
  • For dynamic cyclic interrupt intervals, the typical pattern is to call the original OB code from a higher-frequency OB (such as OB 1) with a software divider, or to use a hardware-generated interrupt from a counter module (FM 350, ET 200S counter) or a digital input configured for interrupt.

For most conversions, the S5 interval is static and the simple HW Config setting is sufficient. Adding a runtime changeable OB cycle requires code restructuring that the S5 to S7 converter cannot perform automatically.

Mapping OB21 Startup Logic to OB100 / OB101

The S5-115U OB 21 is the restart (warm restart) OB. The conversion tool maps it to S7 OB 101 by default. In S7-300, OB 100 runs on warm restart and OB 101 runs on cold restart (or hot restart, depending on CPU).

When the engineer moves the OB 21 code from OB 101 to OB 100, this is the correct choice for a standard S7-300 warm-restart-only configuration. After this move, the warning OB 101 in S7 has no caller appears, which is normal if the CPU is configured for warm restart only. The warning is informational and does not prevent download.

S7-300 CPU Supported Startup OBs Default
CPU 312, CPU 313 OB 100 only Warm restart
CPU 314, CPU 315 OB 100, OB 101 Configurable
CPU 317, CPU 319 OB 100, OB 101, OB 102 Hot restart available

For a CPU 315-2 (such as 6ES7 315-2EH14-0AB0) configured for warm restart, OB 100 is the correct target. OB 101 and OB 102 are not called and can be deleted or left empty. The startup mode is set in the CPU properties under Startup in HW Config or TIA Portal.

CPU944B-Specific System Address Reference

The S5-115U CPU 944B (order number 6ES5 944-7UB11) is one of the most common S5 CPUs in field conversions. It supports the full S5-115U STL instruction set and all standard OBs.

Parameter CPU 944B Value
Order number 6ES5 944-7UB11
User memory Up to 256 KB (with memory card)
Bit flags F 0.0 - F 255.7
System flags RS 0 - RS 255, BS 0 - BS 255
Standard OBs OB 1, OB 2, OB 3, OB 4, OB 10 - OB 19, OB 20 - OB 35
Bit instructions Standard S5 STL set

The system data word layout in Table 6.3 of the S5-115U manual documents the following relevant addresses for cyclic interrupt timing. Any write to RS 100 - RS 103 in the S5 program will fail to convert to S7. The solution is to delete the writes and set the equivalent OB cycle in HW Config.

S5 Source: contains T RS 100 / T BS 100? Yes Delete or comment out the offending line Open HW Config → Cyclic Interrupts Set OB 35 cycle = 120 ms (or required value) Move OB 21 code → OB 100 (warm restart) Compile, download, verify

Verification and Commissioning Checklist

After conversion, the engineer should verify the program before downloading to the live S7-300 CPU:

  1. Compile the S7 program. In SIMATIC Manager, select the S7 program → right-click → Compile All Objects. Confirm no errors.
  2. Check OB presence. Confirm OB 1 (main), OB 35 (cyclic), OB 100 (warm restart) are present in the Blocks folder.
  3. Check FB 220. Open FB 220, confirm the RS 100/BS 100 lines are removed, compile the block.
  4. Check HW Config. Open HW Config, confirm the CPU cyclic interrupt OB (for example, OB 35) is set to 120 ms.
  5. Download to PLCSIM or test CPU. Use S7-PLCSIM to simulate. Trigger a restart and observe OB 100 execution. Force OB 35 to execute by temporarily setting a short cycle (for example, 100 ms) and watching the diagnostic buffer.
  6. Online monitoring. Connect online to the CPU. In PLC → Monitor/Modify, view the cyclic interrupt OB execution. Check the cycle time of OB 35 via the diagnostic buffer (PLC → Diagnostic Buffer → look for "Cyclic interrupt OB 35").
  7. Check diagnostic buffer. PLC → Diagnostic Buffer → confirm no cyclic interrupt errors (for example, "OB 35 not loaded" or "OB execution fault").
  8. Verify scan time. Use PLC → Module Information → Scan Cycle Time to confirm OB 35 is firing at the configured interval.

If all checks pass, the conversion is functionally complete. The remaining task is to map the process I/O addresses (E, A, M, F) to the new S7-300 module addresses, which is a separate operation from the program conversion. The address remapping is performed in the symbol table or directly in the FB/OB source after the converter has finished.

Common S5 to S7 Conversion Errors and Resolutions

Error Message Cause Resolution
Invalid operator on T RS 100 S5 system flag, no S7 equivalent Delete the line; configure OB in HW Config
Invalid operator on T BS 100 Same as above, retained variant Delete the line
Unknown operand on FY 200 S5 flag area beyond S7 range Remap to data block (DB) flag
OB 21 → OB 101 warning Startup OB mapping Move to OB 100 if warm restart only
Timer T 0 - T 31 not supported S5 timer area Map to S7 IEC timers in DB or S5 timer area in CPU
Counter C 0 - C 31 not supported S5 counter area Map to S7 IEC counters in DB
Block call unresolvable S5 FB/DB number conflicts with reserved S7 range Rename to FB/DB 1-255 and remap calls
Absolute address out of range S5 I/O larger than S7 module capacity Add additional S7-300 I/O modules

The complete list of conversion error messages is documented in Chapter 3 of the Siemens STEP 7 From S5 to S7 reference manual. The manual also provides the full mapping rules for every S5 construct encountered during conversion.

Field-Commissioned Notes and Pitfalls

Based on the typical S5-115U to S7-300 conversion workflow, several field-tested notes apply:

  • Always back up the S5 source (.S5D file or program file container) before any conversion. The S5 to S7 converter modifies the source in place in some configurations, and recovery is not always possible from the converted project.
  • Run the converter in dry-run mode first if STEP 7 V5.x supports it (Options → Conversion → Test Run). This produces a conversion log without modifying the project.
  • The S5 to S7 converter leaves commented lines intact. If the S5 source has // T BS 100 from a previous manual edit, the converter will not flag it. Only uncommented :T RS 100; or :T BS 100; lines produce the Invalid operator error.
  • OB 35 is the most common target for S5 OB 10 because its default 100 ms cycle is closest to typical S5 cyclic interrupt intervals. The exact target OB is the engineer's choice; any of OB 30 - OB 38 is valid as long as the cycle matches the S5 RS 100 value.
  • OB 100 vs OB 101 confusion is a frequent post-conversion issue. If the S5 program expects a warm restart (OB 21 in S5) and the converted S7 program places the code in OB 101 (cold restart), the code will not run on a normal power-up. Move the code to OB 100 for warm-restart behaviour.
  • S5 timer and counter areas in the S5-115U (T 0 - T 255, C 0 - C 255) are partially preserved in S7-300 as the "S5 timer/counter area" within the CPU. These timers/counters work but are considered legacy and not recommended for new code.
  • Symbol table conversion often produces warnings about duplicate symbols. Resolve duplicates manually in the S7 symbol table (S7 Program → Symbols) before downloading.

Frequently Asked Questions (FAQ)

What is RS 100 in an S5-115U CPU 944B?

RS 100 is a system data word in the S5-115U system flag area. It sets the execution interval (in milliseconds) of the time-driven organisation block OB 10. The S5-115U manual page 6-13, Table 6.3 lists the full system data layout (RS 0 - RS 255, BS 0 - BS 255) and their meanings.

Why does the S5 to S7 converter flag "T RS 100" as Invalid operator?

The S7-300/400 instruction set has no operator that writes to a system flag word. OB cycle times in S7 are configured in HW Config, not set by program instructions. The converter cannot translate the line and reports Invalid operator at the affected line in the source.

Which S7-300 OB corresponds to S5-115U OB 10?

OB 10 in the S5-115U is a cyclic interrupt. In S7-300, cyclic interrupts are OB 30 through OB 38. Choose one (typically OB 35) and configure the cycle time in HW Config. S7-300 OB 10 itself is a time-of-day interrupt, not a cyclic interrupt, and is not the direct equivalent of the S5-115U OB 10.

Can I set the OB cycle time from the S7 program at runtime?

No, not directly. S7-300 cyclic interrupt cycle times (OB 30 - OB 38) are fixed by the hardware configuration and downloaded with the station. To change the effective cycle from program logic, call the original code from OB 1 with a software timer/divider, or use a counter-driven interrupt from an FM 350 or ET 200S counter module.

I moved my OB 21 startup code to OB 100, but the converter still warns about OB 101. Is this normal?

Yes. The S5-115U OB 21 maps to S7 OB 101 (cold restart) by default. If your S7-300 CPU is configured for warm restart only (OB 100), OB 101 is not called and the warning is informational. You can safely leave OB 101 empty or delete it from the program blocks.

Where can I find the complete S5-115U system data word map?

The S5-115U manual, page 6-13, Table 6.3, documents all system addresses (RS 0 - RS 255, BS 0 - BS 255) and their meanings. The Siemens STEP 7 From S5 to S7 reference manual documents the corresponding S7 conversion behaviour for every S5 construct and provides a complete error-to-remedy mapping table.

Back to blog