Skip to content

Troubleshooting

Causes:

  • The S7 WebServer is not enabled on the CPU.
  • Port 443 (HTTPS) is blocked by a firewall between your PC and the PLC.
  • The IP address is wrong.

Fix:

  1. Open TIA Portal, go to CPU properties → Web server, and confirm Activate web server is ticked.
  2. Compile hardware and download to PLC.
  3. Try pinging the PLC IP from a Command Prompt: ping 192.168.0.1.
  4. If ping works but port 443 doesn’t, contact your network admin about the firewall.

Causes:

  • Wrong username or password.
  • The user account doesn’t exist in the PLC’s WebServer user list.
  • The user account has expired or been disabled.

Fix:

  1. In TIA Portal, go to CPU properties → Web server → User management.
  2. Confirm the username exists and has a matching password.
  3. Download the hardware configuration to the PLC.

S7 PLC Buddy uses a 60-second heartbeat to keep the PLC session alive. If the session still drops:

  • Check that the PC’s network interface isn’t sleeping (Power Management → disable “Allow the computer to turn off this device to save power” for the NIC).
  • Check that the PLC is not configured with an unusually short session timeout in its WebServer settings.

Diagnostic buffer shows #253, 15 instead of text

Section titled “Diagnostic buffer shows #253, 15 instead of text”

This is a known issue with the Siemens WebServer API when the language code is specified incorrectly. S7 PLC Buddy uses the correct format (en-US) by default. If you see unresolved text references, check that your PLC firmware is at the minimum supported version (see WebServer Setup).


See the OPC UA Setup troubleshooting table for OPC UA-specific errors (“Cannot find ANONYMOUS user token policy”, timeouts, credential issues). Note that diagnostic buffer, alarms, runtime info, and module states are not available over OPC UA yet — switch to the WebServer connection method if you need those.


“Invalid API key” or “Missing credentials” error

Section titled ““Invalid API key” or “Missing credentials” error”

Anthropic:

  1. Go to console.anthropic.com → API Keys.
  2. Confirm your key is active. Create a new one if needed.
  3. In S7 PLC Buddy → Settings → AI Agent, paste the key and click Save.

OpenAI-compatible (OpenAI, OpenRouter):

  1. Confirm your API key is active on your provider’s dashboard.
  2. Re-enter it in Settings → AI Agent and click Save.

OpenAI-compatible (Ollama or a self-hosted endpoint): the API Key field can be left blank — these typically don’t require one. If you still see a credentials error, confirm the Base URL is correct and the server is actually running.


“Connection error” with a self-hosted or network-hosted provider

Section titled ““Connection error” with a self-hosted or network-hosted provider”

The app couldn’t reach the Base URL you configured.

Fix:

  1. Confirm the endpoint is running and reachable from your PC (try opening it in a browser, or ping the host).
  2. Double-check the Base URL in Settings → AI Agent, including the port and the /v1 suffix.
  3. If the provider runs on another machine on your network (not localhost), make sure nothing on that machine or your network is blocking the connection.

The agent only reads PLC data when you ask it to. If your question doesn’t explicitly require it, the agent answers from its general knowledge.

Fix: Be explicit: “Read the diagnostic buffer and tell me…” or “Check the current CPU status.”


If the PLC disconnected during a conversation, tool calls that require live PLC data will fail.

Fix: Reconnect via Settings → Connections, then retry your question.


Complex conversations with many tool calls (especially diagnostic buffer reads) consume more tokens.

Reduce costs by:

  • Switching to Claude Sonnet 5 or Haiku 4.5 for simpler questions, or trying a local Ollama model for zero API cost (see Setup & Models).
  • Starting a new conversation for each distinct task (avoids growing context from previous messages).
  • Avoiding the browse_tags tool on large tag namespaces unless you need it.

“404 Not Found” or “404 status code” in the chat

Section titled ““404 Not Found” or “404 status code” in the chat”

The server was reached, but it has no such address. Almost always the Base URL has the wrong ending. The two providers that take a Base URL want different forms:

Provider Base URL should look like Do not
OpenAI-compatible https://api.openai.com/v1 (ends in /v1) leave out the /v1
Anthropic gateway https://your-gateway.example.com end it with /v1

The chat message names the address that was used. Correct it in Settings → AI Agent and save. A gateway host that serves both APIs needs the form of the provider you chose.


Anthropic gateway: “Connection error”, or a max_tokens or thinking error

Section titled “Anthropic gateway: “Connection error”, or a max_tokens or thinking error”
  • “Connection error”: the app could not reach the gateway. Check the Base URL (no /v1), that the PC can reach the host (some gateways need a VPN), and that the key is accepted.
  • 401 or 403: change Send the key as to the other choice (x-api-key or Bearer token).
  • An error about max_tokens: the gateway’s model allows fewer output tokens than the default. Set Max Output Tokens to the model’s limit.
  • An error about thinking: set Extended thinking to Off.

TIA Portal is not running, or it’s running but has no project open.

Fix: Open TIA Portal V21 and load a project, then click Connect in S7 PLC Buddy.


The bundled MCP server uses the V21 Openness API. Earlier versions of TIA Portal are not compatible.


Block export fails with “Inconsistent blocks” error

Section titled “Block export fails with “Inconsistent blocks” error”

TIA Portal requires blocks to be compiled before export. This can happen if a block was recently modified and not recompiled.

Fix: In TIA Portal, compile the affected block (Compile → Software), then retry the operation in S7 PLC Buddy.


The Ladder Migration MCP server parses PDF pages — large programs (50+ networks) can take 1–3 minutes. Wait for the pending indicator to clear.

If it times out (> 10 minutes), the PDF may be image-only (scanned) rather than vector. Re-export from TIA Portal using the print function to get a proper vector PDF.


Migrated SCL doesn’t compile in TIA Portal

Section titled “Migrated SCL doesn’t compile in TIA Portal”

Common causes:

  • Type mismatch — a variable is used as a different type than declared. Ask the agent: “The compiler reports type error on line 42 — can you fix it?”
  • Missing interface declaration — a variable used in the body wasn’t declared in the interface. Ask the agent to add it.
  • Undefined symbol — a tag from the PLC tag table is referenced but not declared. Replace with a local parameter or declare as an external reference.

The agent reports that the file is “not a whole-controller export” when the .L5X is a single routine, rather than the controller. The project tools need an .L5X of the whole controller. An export of a single routine is a different file. Either export the whole project from Studio 5000 (see Studio 5000 project to native Ladder), or ask the agent to migrate that one routine.


The agent says a file is outside the workspace

Section titled “The agent says a file is outside the workspace”

The agent can only read and write inside your workspace folder (Settings → AI Agent → Workspace), also through the TIA Portal and Ladder tools. Copy the .L5X or PDF into that folder and name it in your request.


The migration imports its files in a fixed order and stops at the first failure, because later steps depend on the earlier ones. A block that fails to compile stays in the project and makes every later compile report its errors, so the agent fixes or deletes it before it continues. Ask: “Show me the compiler error for the step that failed and fix it.”

If you re-import an Add-On Instruction’s function block, the instance data blocks of that function block become inconsistent and the blocks that call it fail to compile with a short “Block could not be compiled”. Ask the agent to re-import the instance data blocks.


That is expected for instructions with no automatic equivalent. See Reviewing migrated Ladder for how to find, finish, or leave them.


Reading and writing Ladder as text needs TIA Portal V20 Update 4 or later (V21 is what we test), and the block must not be know-how protected. An existing block is not replaced unless you ask the agent to.


The update box does not appear, or “Check now” shows an error

Section titled “The update box does not appear, or “Check now” shows an error”

The app could not reach the update server. It looks for updates at download.s7plcbuddy.com over HTTPS. If your network uses a firewall or proxy, allow that host. A failed check is ignored by the app and tried again later; you can always install a new version by hand from the website. See Updates.


The AI Agent is answering. The button becomes available as soon as the answer is complete. Choosing Later also works: the update is installed the next time you close the app.


My version is older than 0.3.5 and there is no update

Section titled “My version is older than 0.3.5 and there is no update”

Versions before 0.3.5 cannot update themselves. Install 0.3.5 or newer from the website once.


When contacting support, include the application log:

  1. Go to Settings → System → Diagnostics.
  2. Click Show in Explorer to open the log folder.
  3. Attach main.log to your support email.

Contact: s7plcbuddy+contact@gmail.com