Troubleshooting
S7-300 Modbus TCP registration key ties to the CPU serial number
Short answer
The registration key for the S7-300 Modbus TCP library is bound to the CPU serial number, not to the engineering environment. A key requested against the CPU's serial number can be entered in a TIA Portal project even when the license number names a STEP 7 5.5 library; no new license is needed for that move. Library compatibility with TIA Portal is a separate check.
On this page
- The key binds to the CPU, not to the editor
- Two steps license one CPU
- Requesting the key for your CPU
- Entering the key in the TIA Portal project
- When the blocks still fault, split authorization from connection
- Working the key count for one S7-300 CPU moved from STEP 7 5.5 to TIA Portal
- The decision for each case
- Questions asked
The registration key for the S7-300 Modbus TCP library is issued against the serial number of the CPU that runs the licensed blocks, not against STEP 7 5.5 or TIA Portal. If your license number came with a STEP 7 5.5 library and the program now lives in a TIA Portal project, request the key with the installed CPU's identity, enter it in that project, and keep the license you hold; the change of editor needs no new license and no move back to STEP 7 5.5. Keep two checks separate: the key must match the CPU, and the Modbus TCP library itself must work in the engineering environment you build in. They fail in different ways, and the sections below give you the decision for each case.
The key binds to the CPU, not to the editor #
Licensing for the Modbus TCP library on S7-300 and S7-400 CPUs ties the registration key to the CPU serial number, and the same license serves a project edited in STEP 7 5.5 or in TIA Portal. The editor imports, compiles and downloads the blocks; it never enters the key's identity. That is why a license number that names a STEP 7 5.5 library does not make STEP 7 5.5 the required programming environment: asking for the REG_KEY and entering it in a TIA Portal project for the same CPU is the normal path.
The licensed driver blocks, the library's client and server blocks documented as MB_REDCL and MB_REDSV, carry this licensing behavior on those CPUs. The project-side effects of moving the program between editors are a separate subject; what changes when you move from STEP 7 V5.5 to TIA Portal lists them in What changes when you move from STEP 7 V5.5 to TIA Portal.
Two steps license one CPU #
The licensing documentation for the Modbus TCP library describes the process in two steps: the licensed function reads an identification code from the CPU, the IDENT_CODE, and you then supply the registration key that matches it. Each CPU that runs the licensed blocks is licensed individually, so the number of keys equals the number of CPUs running MODBUSPN, whatever the project count or editor count around them.
Testing is not blocked while the paperwork is pending. The documentation states that no license is needed for testing, so you can prove the connection and the register map first and enter the key before the line goes into regular production running.
Requesting the key for your CPU #
- Read the serial number of the installed CPU that will run the blocks, from the unit itself or from online diagnostics, and confirm the online value and the printed value refer to the same hardware.
- Run the project so the licensed library reports the IDENT_CODE for that CPU; that value is what the registration scheme is built on.
- Open the Siemens industry support portal, select the product category for the Modbus TCP library, and attach the registration form with your license number and the CPU identification: the order number in the 6ES7 range and the serial number from step 1.
- Wait for the REG_KEY response, then store it together with the license record and the CPU identity, so a later hardware change does not turn into an unexplained authorization fault.
Entering the key in the TIA Portal project #
Enter the issued value where the library takes it: the licensing data the licensed blocks supply, not the editor's own license manager. Paste it exactly as issued, compile, and download the changed program to the same CPU the request identified. Do the download in a planned commissioning window with the machine in a safe state. Then read the library's authorization indication in online mode: an accepted license, or no authorization fault, confirms the entry. A key pasted into an unrelated project field authorizes nothing, and there is no reason to rebuild the program in STEP 7 5.5 for this step.
When the blocks still fault, split authorization from connection #
- Authorization diagnostic rejects the key. Compare the serial number in the online diagnostics with the serial number the key was issued for, and check the key reached the licensing data unchanged, with no truncation.
- Key accepted but no TCP connection opens. Licensing is finished; the fault has moved to the network: peer address, service port, and which side is client and which is server. What you must configure on the PLC side for Modbus TCP covers that setup.
- Connection established but the request is rejected. Check the function code, the address range and the peer's data map.
- A response arrives but a value is wrong. Check the register mapping, the data type and word order, then the scaling on both sides.
Working the key count for one S7-300 CPU moved from STEP 7 5.5 to TIA Portal #
Inputs, with their source: one installed S7-300 CPU that runs the licensed Modbus TCP blocks (the installation in question); one license already held, delivered with the STEP 7 5.5 library (the license number on your certificate); one TIA Portal project aimed at that same CPU (the program as it stands); zero replacement CPUs (no maintenance event pending).
Rule, in words: every CPU that runs the licensed blocks needs exactly one registration key issued for its serial number, and the editor count and project count do not enter the count at all.
Arithmetic: keys needed = CPUs running the licensed blocks = 1. New licenses needed for the editor change = licenses required for that CPU (1) minus licenses already held for it (1) = 0. If the machine later gains a second CPU that also runs the blocks, keys needed = 1 + 1 = 2, one per serial number.
Result: one key request outstanding, zero licenses to buy for the move.
Decision: for the single-CPU move, request the one key with the installed CPU's serial number and IDENT_CODE, enter it in the TIA Portal project, and buy nothing. For the second-CPU case, buy one more license and request one more key for that CPU's serial number; the first key does not stretch to cover a second unit.
The decision for each case #
- Same CPU, program moved from STEP 7 5.5 to TIA Portal: keep the license, request the key for that CPU's serial number, enter it in the TIA Portal project. No new license, no move back to STEP 7 5.5.
- Additional CPU running the licensed blocks: one license and one key per CPU, each key requested with that CPU's own serial number.
- CPU replaced under maintenance: the serial number changes, so the key issued for the old unit no longer matches; run the same request steps with the new serial number and the IDENT_CODE the library reports for the new unit.
- Key entered and accepted but communication still fails: stop checking licensing and work the connection checks, peer address, service port, client and server roles, register map.
Questions asked
Does the registration key authorize the other device on the Modbus TCP link too?
No. The key authorizes the licensed Modbus TCP blocks on one S7-300 CPU, identified by that CPU's serial number. The peer device on the link, a drive, a gateway or another controller, is configured and authorized on its own side; nothing in the S7-300 registration affects it. If the peer needs its own license for its Modbus role, that is a separate matter with its own vendor process.
What happens to the license when a failed S7-300 CPU is replaced?
The license is CPU-specific and cannot be transferred from one CPU to another. A replacement CPU carries a different serial number and reports a different IDENT_CODE, so request a new registration key for it through the same registration channel, pairing the license number with the new CPU identity. The retired unit's key stays with that unit; keep its record for the paper trail.
Is the registration key the same thing as the license number?
No. The license number is the entitlement you bought, and it names the library. The REG_KEY is the value generated against one CPU's identity: the request pairs the license number with the CPU serial number and the IDENT_CODE, and the issued key is what you enter in the project. Keep both recorded, but they are not interchangeable and one never replaces the other.
Does a later download or a new project copy invalidate the entered key?
No. The key authorizes the CPU, so downloading the same project again to the same CPU keeps the authorization. The risk is a project copy that predates the key entry: downloading that copy removes the key value, and the blocks report missing authorization. Keep the issued key recorded outside the project so you can paste it back into the licensing data and download again.