E0005

Code

E0005

Message

Program is not a Structured Text source or compiled .iplc container

The program selected for debugging is neither a Structured Text source nor a compiled .iplc container.

The IronPLC debugger can launch either a Structured Text source file, which it compiles first, or an already-compiled .iplc container, which it runs directly. A program of any other type is rejected before it reaches the debug server, because handing an unrelated file to the server would fail with an opaque “invalid magic number” error instead of a message you can act on.

A common way to hit this is "program": "${file}" combined with the wrong editor being focused: ${file} follows the active editor, so pressing F5 while launch.json is focused makes launch.json the program.

Solutions:

  1. Point at a source file: Set program to a .st (or other Structured Text) file that you want to debug.

  2. Point at a container: Set program to a compiled .iplc file produced by ironplcc compile.

  3. Check ${file}: If you use "program": "${file}", focus the Structured Text editor before pressing F5, or replace ${file} with an explicit path such as ${workspaceFolder}/main.st so the program does not depend on the active editor.

Think IronPLC is wrong about this?

If you believe this diagnostic is incorrect, open an issue on GitHub with a small sample that demonstrates the problem.