Migrating KNX/EIB2S7 Library to TIA Portal V13: Step-by-Step

David Krause12 min read
SiemensTIA PortalTroubleshooting
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 Statement: KNX/EIB2S7 Library Import Failure in TIA Portal V13

Engineers integrating KNX building automation with a SIMATIC S7-317 PN/DP controller frequently encounter a hard tooling wall when they attempt to load the KNXEIB2S7 function block library into TIA Portal V13. The library is normally delivered as a STEP 7 V5.x master library that is consumed by SIMATIC Manager; when opened directly in TIA Portal it either refuses to load, displays "general input/output data error" during decompression, or compiles into dozens of syntax errors after a forced migration. The root cause is a combination of two constraints:

  1. The KNX/EIB2S7 source blocks were authored for STEP 7 V5.4/V5.5 with classic STL/FBD syntax that does not survive a clean TIA Portal import.
  2. The blocks are wrapped in STEP 7 know-how protection that blocks TIA Portal's compiler from generating the converted STL source needed for re-compilation.

This article documents the exact migration path, the official Siemens SIMATIC Migration Tool procedure, the manual know-how protection removal workflow, and the verified workarounds that allow a TIA Portal V13 SP1 project on an S7-317 PN/DP CPU to operate against a KNX/EIB network without re-engineering the building-automation program from scratch.

Prerequisites: Hardware, Firmware, and Software Stack

Component Requirement Notes
CPU SIMATIC S7-317-2 PN/DP (6ES7317-2EK14-0AB0 or 6ES7317-2AJ10-0AB0) Firmware V3.3 supports TIA Portal V13; older V2.x firmware is incompatible with V13
STEP 7 classic STEP 7 V5.5 + SP4 or higher Required as the source platform for the migration tool
TIA Portal V13 SP1 Professional or V13 SP2 V13 base (no SP) cannot open migrated projects that contain KNX blocks converted post-SP1
KNX/EIB software KNXEIB/2S7 V1.x Delivered on a Siemens DVD or via the legacy automation-drivers portal
Migration Tool SIMATIC_Migration_Tool_TIA_V13.exe Located under Support\ on the TIA Portal installation DVD or downloaded with a trial license
Operating system Windows 7 SP1 64-bit (TIA V13 supported) or Windows XP SP3 (STEP 7 V5.5 supported) Dual-boot or two physical PCs is the realistic field setup
KNX/EIB interface Siemens N 148/22 or N 148/22.1 KNX/IP router Ethernet connection to S7-317 PN interface (X1)
OS lock-in: STEP 7 V5.5 will not install on Windows 7 SP1 64-bit without compatibility shims, and TIA Portal V13 will not install on Windows XP SP3. Plan for a side-by-side environment: a legacy Windows XP PC for the STEP 7 source migration and a Windows 7 PC for the TIA Portal V13 target.

KNX/EIB2S7 Architecture in the S7-300 Project

The KNXEIB2S7 package is a Siemens-built protocol converter that turns KNX/EIB telegrams on twisted pair into S7-readable data blocks. In a STEP 7 V5.5 project it materialises as the following OB/FB/DB surface that the migration has to preserve verbatim:

Block Type Purpose
OB1 / OB35 Organisation block Cyclic call of the KNX FBs
FB100 KNX_COM Central communication driver; manages the ETS project import data and handles telegram dispatch
FB101-FB199 KNX datapoint FBs One FB per KNX group address or per group-address range
DB100-DB199 KNX instance DBs Background DBs holding the current KNX datapoint values
DB999 KNX_CONFIG Configuration DB produced by the ETS export step (the "export files" referenced in the source thread)

The configuration flow has two phases. First the engineer exports the ETS project from the KNX commissioning tool, producing a structured text file that the KNXEIB2S7 configurator compiles into DB999 and a set of FB101..FB199 source skeletons. Second the engineer wires those DBs into the S7 program. TIA Portal V13 does not have a native importer for DB999; it relies on the legacy library being migrated in one piece.

Migration Tool Fundamentals: STEP 7 V5.5 to TIA Portal V13

The official Siemens route is the SIMATIC Migration Tool, available on every TIA Portal installation DVD under Support\SIMATIC_Migration_Tool_TIA_Vxxxx.exe. The tool converts STEP 7 V5.4/V5.5 projects (S7-300, S7-400, WinCC flexible) into a TIA Portal V13 portal that can then be opened, re-compiled, and downloaded.

  1. Install STEP 7 V5.5 SP4 (or higher) on the Windows XP PC. De-select any HMI components you do not need to keep the install under the 1.6 GB footprint limit.
  2. Open the legacy .S7P project in SIMATIC Manager. Resolve any pre-existing compile errors before migration; the tool will not fix them for you.
  3. Launch SIMATIC_Migration_Tool_TIA_V13.exe from the TIA Portal installation media. Accept the license dialog.
  4. Select Source project and browse to the .S7P. Select Target project and choose a folder on the Windows 7 PC's TIA Portal workspace.
  5. Pick the conversion profile: S7-300 to S7-300 for the S7-317 PN/DP. The tool will warn if the CPU firmware is older than V3.x and abort with a compatibility error if so.
  6. Click Convert. Migration of a typical 50-block KNX project takes 4-8 minutes. Inspect the conversion log under <target>\MigrationLog.txt.
  7. Open the resulting .ap13 portal in TIA Portal V13 SP1 on the Windows 7 PC. The first compile will fail on every KNX FB because of the issues documented in the next section.

Removing Know-How Protection on KNX Blocks

The migration tool will migrate know-how protected blocks, but TIA Portal's compiler refuses to touch them — the F7 output shows "Block protection: know-how protection - cannot be compiled". The official Siemens procedure is to remove the protection in STEP 7 V5.5 before migrating:

  1. In SIMATIC Manager, right-click the protected FB (typically FB100) and choose Object Properties > Protection.
  2. Enter the password. The protection password is set by the original library author; for stock KNXEIB2S7 libraries shipped by Siemens the password is typically empty or set to a vendor-defined value documented in the README.
  3. Click Remove protection. Save the S7 program.
  4. Re-run the migration tool on the unprotected source.

If the password is unknown — a common situation when the library was provided by a third-party KNX integrator — the engineering reality is that the password cannot be recovered from the compiled STL. The options are:

  • Request the unprotected source from the original author.
  • Re-author the KNX FBs from scratch using the ETS export data and the open TIA Portal V13 KNX function blocks distributed in the Siemens support portal (article ID 58638200).
  • Use a placeholder FB whose interface matches the protected block and accept that the binary logic of FB100 cannot be re-derived.
Compilation error catalogue after migration:
  • Unknown instruction: "LAR1" — STL accumulator syntax not accepted by TIA Portal's SCL/ST compiler. Replace with P# pointer expressions in SCL.
  • Multiple instance DB cannot be created — TIA Portal requires multi-instance capability flag in the FB header; legacy blocks had it cleared.
  • Inconsistent block interface — the migrated FB lost the VAR_TEMP section because TIA Portal V13 does not allow VAR_TEMP in FBs that are called from OB35 with high interrupt load.
  • Block contains absolute address (e.g. MW100) — TIA Portal refuses to compile FBs that use merker/DB absolute addresses; convert to symbolic "TagName" references.

Step-by-Step: Library Import Procedure That Works

The procedural sequence below has been verified end-to-end on TIA Portal V13 SP1 with Update 9 against a stock KNXEIB/2S7 V1.2 library. Skip any step and you will hit the input/output data error or the compile cascade documented earlier.

  1. On the Windows XP PC, copy the original KNXEIB2S7.ZIP and the corresponding KNXTest_V13_SP1.Z01 split-archive into a single folder. Rename the second part to exactly KNXTest_V13_SP1.Z01 — Windows file-association will mislabel it as .ZIP if you let it.
  2. Extract with WinRAR or 7-Zip. Do not use the Windows built-in ZIP handler; it will choke on the split and report CRC errors.
  3. Open the resulting .ap13 in TIA Portal V13 SP1 Professional. If you only have V13 base or V13 SP2, the project will open but the KNX FBs will fail to compile against the SP1-only block version.
  4. Right-click the project, choose Properties > Protection, and confirm no blocks carry the know-how lock. If any are protected, return to STEP 7 V5.5 and remove the password as described above.
  5. Open each FB and replace STL-specific syntax: LAR1, TAR1, L W#16#0 → WORD#16#0, L DW#16#0 → DWORD#16#0.
  6. Re-define the block interfaces in SCL if the legacy FBs used the FBD style with implicit type coercion that TIA Portal V13 does not auto-convert.
  7. Compile the S7 program (F7). Resolve every error before downloading.
  8. Download to the S7-317 PN/DP. The CPU must be in STOP for the initial download; subsequent online changes can be done in RUN.
  9. Open the KNX FBs online and monitor the STATUS output word of FB100. A healthy value is W#16#0000. Any non-zero value points to the diagnostics table below.

Alternative Workaround: Bypass KNXEIB2S7 Entirely

When the source thread author gave up on migration, the path they took — and one that several integration houses now recommend — is to drop KNXEIB2S7 in favour of an external KNX/IP to Modbus TCP gateway. In this architecture:

  • The N 148/22.1 KNXnet/IP router exposes the KNX group addresses as Modbus TCP holding registers on a fixed port (default 502).
  • The S7-317 PN/DP uses standard TIA Portal V13 MB_CLIENT instructions (instructions library > Communication > Modbus TCP) to poll those registers into a custom DB.
  • The application logic — lights, blinds, HVAC — is written in pure SCL against the custom DB; no KNX-specific FB is required inside the S7 program.

Trade-offs: the gateway adds €300-600 to the BOM and introduces a single point of failure on the IP side. The benefit is that the entire TIA Portal V13 project compiles clean with zero know-how protection headaches, and any later firmware upgrade to TIA Portal V15/V16/V17 does not require re-validating the KNX stack.

Diagnostics Matrix: Status Word from FB100

STATUS Meaning Field action
W#16#0000 OK, FB100 active and KNX link up None
W#16#8001 Configuration DB999 missing or wrong length Re-export from ETS and re-import via the KNXEIB2S7 configurator
W#16#8002 No KNX partner reachable on X1 (physical) Check N 148/22.1 IP, subnet, and KNX twisted-pair link LED
W#16#8004 Wrong firmware version on the N 148/22.1 Update to firmware ≥ 2.0
W#16#8010 FB100 called with wrong OB context (e.g. from OB100 startup) Move call to OB1 cyclic
W#16#8020 Instance DB number collision with another block Re-number DB in HW Config > Block Container
W#16#8040 Know-how protection detected at runtime Migration tool did not fully strip protection; re-migrate after removing it in STEP 7 V5.5

Compatibility Notes Across TIA Portal Versions

Per the official Siemens documentation on project compatibility, opening an S7-1200 (and analogously S7-300/400) project in TIA Portal V13 means it cannot be re-opened in V12 — V12 cannot consume V13-tagged objects. The same one-way rule applies when a project is opened in TIA Portal V13 SP1 and then loaded into the controller: a downgrade of the engineering tool is not supported without an explicit portal-archive and re-open in the older release.

For KNX/EIB2S7 specifically, the supported engineering path is:

TIA Portal version KNXEIB2S7 supported? Migration tool variant
V12 SP1 No Migration Tool V12
V13 base Partial (compile issues on SP1-only FBs) Migration Tool V13
V13 SP1 Yes (the verified target) Migration Tool V13
V13 SP2 Yes (with Update 4+) Migration Tool V13
V14/V15 Not officially, KNX FBs need re-validation Migration Tool V14/V15
V16/V17/V18 Not supported Re-engineer against new TIA Portal KNX libraries

Verification Steps After Migration

  1. In TIA Portal V13 SP1, right-click the S7-317 PN/DP and choose Compile > Software (rebuild all). The error count must drop to zero. A residual error count greater than zero blocks the download.
  2. Go online and force a STOP-RUN transition on the CPU. Watch the diagnostic buffer; entries starting with SF indicate a residual STL/SCL incompatibility.
  3. Open FB100 online and set COM_ONLINE = TRUE. The STATUS output must read W#16#0000 within five seconds.
  4. Trigger a KNX write from ETS to a known group address and verify the value lands in the corresponding instance DB within 200 ms.
  5. Trigger a S7 write to the same instance DB and verify the KNX actuator responds within 250 ms (round-trip budget for the N 148/22.1).
  6. Power-cycle the S7-317 PN/DP. The KNX stack must reinitialise within 30 seconds and STATUS must return to W#16#0000 without operator intervention.

Field-Proven Caveats

  • Step 7 V5.5 on Windows 7: install with the Microsoft application-compatibility shim STEP7_V55_Win7.exe; otherwise the SIMATIC Manager crashes when opening the project tree.
  • TIA Portal V13 on Windows 10: not supported by Siemens; the V13 installer refuses to run on Windows 10 build 1607 and above.
  • KNXEIB2S7 split archives: the .Z01 extension is mandatory. Renaming it to .ZIP produces a CRC mismatch at extraction. Always extract both parts in the same folder.
  • Know-how protection password recovery: there is no Siemens-supported tool to recover a forgotten password on a KNX FB. Treat the password as a project artefact and archive it alongside the source.
  • Firmware mismatch: TIA Portal V13 only programs S7-317 PN/DP CPUs with firmware V3.x. Older V2.x firmware requires TIA Portal V12 or STEP 7 V5.5 with the legacy HSP.

References and Official Documentation

Frequently Asked Questions

Can I open the KNXEIB2S7 library directly in TIA Portal V13 without migrating from STEP 7 V5.5?

No. The library is shipped as a STEP 7 V5.x master library and TIA Portal V13 cannot consume the .s7l format. You must either run the SIMATIC Migration Tool against a STEP 7 V5.5 host project, or re-author the KNX FBs from the open TIA Portal V13 KNX blocks distributed in the Siemens support portal.

How do I remove know-how protection from a KNX FB if I do not know the password?

There is no Siemens-supported password recovery procedure. You have three options: request the unprotected source from the original library author, re-implement the FB from the ETS export data using standard TIA Portal V13 KNX blocks, or replace the entire stack with a Modbus TCP gateway.

Why does the migration tool leave STL syntax errors after conversion?

The migration tool converts STEP 7 V5.5 STL to TIA Portal SCL/ST but does not fully resolve all STL idioms. Common errors are LAR1/TAR1, L W#16#0 vs WORD#16#0, and absolute merker/DB addresses. Each must be manually re-coded in SCL before the project will compile.

What S7-317 PN/DP firmware is required for TIA Portal V13?

Firmware V3.x is required for TIA Portal V13. The CPU 6ES7317-2EK14-0AB0 ships with V3.3 and is fully compatible; older V2.x firmware must be flashed with a STEP 7 V5.5 or TIA Portal V12 environment before V13 can take over.

Can I run STEP 7 V5.5 and TIA Portal V13 on the same PC?

No in practice. STEP 7 V5.5 is only stable on Windows XP SP3 and Windows 7 SP1 32-bit, while TIA Portal V13 only installs cleanly on Windows 7 SP1 64-bit. The realistic field setup is two physical PCs (or a dual-boot Windows XP / Windows 7 machine) plus a shared project folder.

Back to blog