IMDHMIControls LibraryShop main store

Troubleshooting

Why an S7-1200 password prompt clears after a power cycle

PLC programming Published 8 min read

Short answer

An S7-1200 password prompt that appears after some operating time and clears on a power cycle is runtime communication state, not stored access protection. Stored protection levels survive restarts and reproduce a prompt every time; verify the online protection matches the downloaded Full access setting, then correlate failures with VPN drops and stale OPC UA sessions on ports 102 and 4840 before touching firmware.

On this page
  1. Stored protection cannot produce a prompt that a restart clears
  2. Verify the protection the CPU actually holds
  3. What ping and open ports prove
  4. Separate the OPC UA path from the TIA Portal path
  5. Count and age the OPC UA sessions
  6. Read the diagnostic buffer and the firmware release notes
  7. The decision for each case
  8. Questions asked

An S7-1200 that demands a password from TIA Portal while the offline project sets Full access (no protection) is not failing in stored protection. A protection level and its password are part of the downloaded configuration: they survive every power cycle and reproduce the prompt on the first connection after every restart. A prompt that appears only after some operating time and disappears after a restart comes from the CPU's runtime communication state - connections and OPC UA sessions stranded by the VPN, exhausting the resources that the TIA Portal path on TCP port 102 and the OPC UA server on TCP port 4840 share. Verify the protection the CPU actually holds first, then correlate failures with tunnel drops and session counts, and read the diagnostic buffer and firmware release notes last.

Stored protection cannot produce a prompt that a restart clears #

The access-control documentation for the S7-1200 puts the protection levels and their passwords in a table on the CPU's Properties tab, one password entry per level, and the CPU enforces the level that was last downloaded. Full access (no protection) stores no password. The two companion switches - protecting the confidential PLC configuration data and restricting PG/PC and HMI communication to secure connections - change how credentials are handled; neither invents a prompt on its own.

Because all of that is downloaded configuration, its failure signature is deterministic: a stored level challenges you on the first connection attempt after every start-up, on every retry, from every client. The behavior in this case is the opposite - normal access for a while, then a prompt that names HMI and diagnostics access on a protected device, then normal access again after a power cycle. An intermittent prompt cannot live in a non-volatile settings table.

The prompt's wording is a clue, not a verdict: it challenges the HMI and diagnostics access level, and the offline project defines no password for any level. The challenge therefore reflects what the CPU's security layer is doing at that moment, not what the project stores. The same mismatch - a prompt that appears although its source setting is off - exists on the visualization side too; the knowledge-base article on a file server authentication prompt that appears despite being disabled works that variant in detail.

Verify the protection the CPU actually holds #

The offline project describes what was configured, not what the CPU currently holds, so confirm the two match:

  1. Connect an engineering station to the same local network segment as the CPU, with no VPN in the path.
  2. Go online and read the protection and access-control state under Online & diagnostics for the CPU.
  3. Compare it against the table in the offline project's CPU properties.
  4. Expect the online state to match Full access (no protection). A mismatch means a different configuration is loaded: download the intended project over this local connection. A mismatch is a download fault with a one-download fix - the prompt will then be gone, or consistently present if a level is genuinely protected.
  5. Decision point: if the local connection also produces the prompt while the fault is active, the VPN is not the trigger and the session checks below apply; if the local connection works while the remote one fails in the same time window, the tunnel is the trigger.

What ping and open ports prove #

A successful ping proves IP reachability. A successful TCP connect to port 102 or 4840 proves the network stack is accepting connections. Neither proves the application layer can allocate a connection resource, bind a security context, or complete an access handshake - and a CPU in the failed state passes both tests, which is exactly why this fault is easy to misread as a protection change. Reachability without a working session is its own case: the article on why an S7-1200 shows link lights but TIA Portal cannot connect walks that pattern and its fixes.

A tunnel that drops or renegotiates while sessions are open leaves the CPU holding connections whose peer no longer exists. The CPU releases each one only when its own timeout or keep-alive detection fires, so drops arriving faster than timeouts strand connections faster than they clear. Correlate before changing anything:

  • Record every tunnel drop, rekey and client reconnect with timestamps.
  • Record when the prompt first appears after the last clean restart.
  • Expect the prompt to follow a cluster of drops if this branch is right; a failure with a stable tunnel and no client activity points at the OPC UA server itself.

Separate the OPC UA path from the TIA Portal path #

Run one protocol alone for a full observation window. Stop the OPC UA client and use only TIA Portal: if the prompt never returns, OPC UA session handling drives the fault; if it still returns, the fault is independent of OPC UA. Reverse the test next - only the OPC UA client connected, TIA Portal idle. If the session fails on its own, the OPC UA server is the failing component.

Read the status code the client reports, because it narrows the cause precisely:

  • BadInternalError at ActivateSession means the server accepted the session and then failed internally while binding the identity or security context - a server-side internal error.
  • A credential or certificate problem carries its own standard OPC UA status codes, such as an untrusted certificate or a rejected identity token. Replacing client certificates or user tokens cannot fix a server-side internal error.
  • A clean refusal at a resource limit is reported differently: the TIA Portal OPC UA documentation states the server sends BadOutOfMemory when the server's maximum quantity structure is exceeded, and it signals plainly when a system limit is reached. BadInternalError sits outside both families, which points it at the server's internal state rather than at your credentials or a documented limit.

A timeout inside the OPC UA secure channel on the same CPU family is a different signature with its own causes, covered in the S7-1200 OPC UA secure channel timeout article.

Count and age the OPC UA sessions #

Every OPC UA client connection consumes a server session and a share of the CPU's communication resources. A session abandoned by a dropped tunnel stays occupied until the negotiated session timeout expires; the CPU cannot tell a crashed client from a slow one. Read the maximum session count and the session timeout from the OPC UA server settings in the CPU properties - they depend on the CPU and firmware, so read your own values instead of assuming a default. Then apply the session hygiene:

  • Disconnect explicitly in the client before closing it or the tunnel.
  • Disable automatic reconnect while testing; a reconnect after a drop opens a new session while the abandoned one still occupies its slot.
  • Keep the client-requested session timeout near what the application actually needs; an inflated request keeps dead sessions alive longer.

Worked example: session budget arithmetic #

The numbers below are example inputs; read your own values from the CPU properties, because the arithmetic is what transfers. Suppose this CPU's OPC UA server allows 8 parallel sessions, an HMI and a historian hold 2 permanently, and each client negotiates a session timeout of 1 hour. Free budget: 8 - 2 = 6 sessions. The tunnel drops 12 times per hour and strands one session per drop, and stranded sessions live 1 hour, so the stranded load builds toward 12 per hour x 1 hour = 12 sessions. That passes the 6 free slots before steady state: exhaustion arrives after 6 / 12 per hour = 0.5 h, about 30 minutes of drop clusters. The next session creation then fails with the server unable to bind anything - the BadInternalError the client sees, while TIA Portal sees its challenge.

A power cycle frees every stranded session at once, which is why the restart restores access and the prompt recurs after some operating time. Both levers are quantified: cutting the drop rate to 2 per hour strands 2 x 1 hour = 2 sessions, a total of 4 of 8, and shortening the negotiated timeout to 10 minutes strands 12 x 1/6 h = 2 sessions at the original drop rate. Either brings the stranded load under the budget.

Read the diagnostic buffer and the firmware release notes #

Export the CPU diagnostic buffer immediately after a power cycle, then again as soon as the fault recurs; use the local engineering-station connection when the tunnel path is blocked. Expect entries whose timestamps bracket the failure - communication, resource or restart events. An empty buffer at the failure time is itself a finding: it marks an internal communication-stack condition that the buffer does not log.

The OPC UA server keeps its own diagnostics view, and the TIA Portal documentation states the server tells you when a system limit is reached. Check that view for limit entries at the failure time before concluding a defect. Then read the firmware version under Online & diagnostics, General, and compare it against the release notes for that exact CPU order number on the Siemens support portal. Update only when a listed fix matches this signature - OPC UA, communication resources or access protection - and follow the documented update procedure in the CPU manual. Do firmware updates and access-protection changes in a maintenance window with the project under change control, never live on a running line.

The decision for each case #

  • Online protection does not match the offline project: stored configuration. Download the intended project over a local connection - the fault is a download mismatch, not runtime state.
  • Protection matches and failures follow tunnel drop clusters: runtime state from stranded connections and sessions. Fix the tunnel, close clients explicitly, shorten the negotiated session timeout, and verify by running the same load past the interval that previously failed.
  • OPC UA fails alone with BadInternalError while the tunnel is stable: check the OPC UA limit view first, and if quantity limits are near, reduce the number of registered OPC UA elements - the remedy the error-code documentation names for an exceeded quantity structure. If no limit entry matches, take the diagnostic buffer, the limit view, the firmware version and the correlation log to the vendor support channel for that CPU order number.
  • The prompt reproduces on the first connection after every restart: the protection table after all. Correct the level in the project and download it deliberately under change control.

Questions asked

Which TCP ports do the two access paths use?

TIA Portal online access and HMI connections use TCP port 102, the S7 protocol port. The OPC UA server on the CPU uses TCP port 4840, the OPC UA default. Both protocols draw on the same communication resources inside the CPU, which is why one exhausted stack produces the password prompt and the OPC UA session failure at the same time.

Does a crashed OPC UA client free its session immediately?

No. The server keeps the session until the negotiated session timeout expires, because it cannot distinguish a crashed client from a slow one behind a broken tunnel. Only an explicit disconnect frees the slot immediately. That is also why automatic reconnect after a tunnel drop makes things worse: it opens a new session while the abandoned one still occupies its place.

Will updating TIA Portal fix the prompt?

Not by itself. A power cycle that clears the fault is evidence the cause sits on the controller side, not in the engineering station: the prompt and the session failure both originate in the CPU's communication resources. Keep the engineering station current, but expect the fix in tunnel stability, session hygiene, or a matching entry in the CPU firmware release notes.

How do you prove a fix held?

Reproduce the old failure conditions instead of waiting. In the worked example the session budget emptied in about 30 minutes of tunnel drop clusters; run the same client load with the tunnel monitored for several times that interval. A clean run past the previous failure time, with no password prompt and no session errors in the client, is the evidence the fix works.

Keep reading

  • Explainer

    Why a MicroLogix 1200 has no read-only password for techs

    No. RSLogix 500 gives SLC 500 and MicroLogix controllers a single controller-level password, set in Controller Properties: whoever holds it can view, edit, and download, and whoever does not is locked out. Clear online edits per ladder file and treat the memory module as recovery — monitoring access must be solved procedurally, because no read-only login exists.

    PLC programming

  • Troubleshooting

    Fix STEP 7 V5.5 warning after TIA Portal wrote an S7-300

    Download the hardware configuration and blocks from a freshly created SIMATIC Manager project and the warning clears; a CPU 313C-2DP recovered exactly this way. Formatting the MMC with the mode switch (MRES held roughly 9 s until the STOP LED stays lit) does not clear the TIA-written state, so use it only when you also want the card empty.

    PLC programming

  • Troubleshooting

    PLC-5/80E loses scan list on remote I/O after power cycle

    Auto-negotiate selected on Ethernet Channel 2 of a Series F Revision A PLC-5 clears the chassis scan list on the remote I/O scanner channels whenever the processor power cycles. Disable auto-negotiate and hard-set 100 Mbps full duplex, or flash Revision A.1 or newer; Auto-Config only rebuilds the list after each event.

    PLC programming