Documentation
Usage Guide
Install, scope, inspect, test, and check Siemens PLC projects.
Usage Guide
This guide covers the companion workflow for using Dynamic PLCCheck for Siemens with Siemens SCL / Structured Text projects and TIA Portal export files.
The extension is not intended to replace TIA Portal. Use TIA Portal for the canonical engineering-station workflow, then use VS Code for the parts where text files, fast navigation, fast tests, CLI checks, and LLM-assisted review are more efficient.
Install
Install the extension from one of the public registries:
The extension ships with the Go language server backend. You only need to configure a custom backend if you are developing the extension or testing a local language-server build.
Supported Files
The extension activates for these Siemens-related files:
| File type | Purpose |
|---|---|
.scl, .st | SCL / Structured Text source |
.s7dcl | TIA block export files, including FBD/LAD previews |
.s7res | TIA resource strings and titles |
.udt, .db, .awl | Additional Siemens PLC source/export files |
.scltest | PLC test scenarios |
PLC tag-table .xml | Tag-table editor, symbol indexing, and XML diagnostics |
Create PLC Scopes
Add a .plc.json file at the root of each PLC project. This gives the language server a stable boundary for symbol indexing and prevents types from one PLC from leaking into another PLC in the same VS Code workspace.
{
"name": "PackingLine PLC",
"description": "Main line controller",
"libraries": [
"../shared_types",
"../lib/opc_blocks"
]
}
Library paths are resolved relative to the .plc.json file. Editing or adding .plc.json files causes the language server to rescan automatically.
Recommended Companion Workflow
- Export or sync PLC source from TIA Portal.
- Open the exported project in VS Code.
- Add
.plc.jsonfiles to define PLC roots when needed. - Use diagnostics, hover, completion, and go-to-definition for fast review.
- Use the FBD preview and tag-table editor for TIA-specific export files.
- Add
.scltestunit tests for important FB/FC behavior. - Run checks and tests from VS Code, a terminal, or CI.
- Bring the validated changes back into the TIA Portal workflow.
Use Language Features
Open supported PLC files in VS Code and use the normal editor workflow:
- Diagnostics and type checking are reported in the Problems panel.
- Hover shows resolved type information.
- Completion works across scoped PLC symbols.
- Go to Definition follows quoted identifiers and library references where the source is available.
.s7dclfiles show inlay hints for.s7restitles and can navigate to resource entries.
Preview S7DCL Blocks
For .s7dcl files, use Open S7DCL Preview (FBD) from the editor title menu, Explorer context menu, or Command Palette.
The preview is useful when reviewing TIA Portal exports because it shows the block structure without requiring a full Portal session.
Edit Tag Tables
For tag-table XML files under a PLC tags folder, the extension opens the dedicated PLC Tag Table Editor by default.
Use it when you want a table-oriented view over exported tag data. The language server also scans these XML files for global symbols and reports diagnostics such as duplicate names, undefined types, and naming conflicts.
Write PLC Tests
Create .scltest files next to your PLC project to validate logic directly from VS Code.
TEST_TARGET "MotorControl_FB";
TEST_CASE "Start motor"
HOLD UUT.Start := TRUE;
SET UUT.Stop := FALSE;
WAIT_CYCLES 1;
ASSERT UUT.Running = TRUE;
RELEASE_ALL;
END_TEST_CASE
Use the VS Code Test Explorer to discover and run test cases. For full syntax and execution semantics, see the PLC testing guide rendered in this documentation site.
The test runtime is designed for iteration speed. TIA unit tests can spend about two seconds resetting memory between tests; this workflow resets generated runtime state in milliseconds, which makes small unit tests practical while editing.
Inspect Coverage
PLC test runs can produce coverage data for SCL source files. The extension surfaces this feedback in VS Code so you can see which files and folders are covered while you work through test cases.
Use coverage when you are turning exported logic into reviewable, repeatable unit tests. It helps identify branches and blocks that still only exist as manual TIA Portal checks.
Debug and Monitor Live State
The extension includes PLC debug views for runtime state and watch expressions. Unlike TIA watch tables that primarily show the latest monitored value, this workflow records state so you can inspect what a value was at a specific point in the program while stepping through execution.
Use the PLC Debug Dashboard for runtime health, cycle timing, memory information, and live polling status. Use PLC Live Watch for selected tags and expressions during a debug session.
Use plccheck From a Terminal
The same checks and tests can run outside VS Code through the public plccheck CLI.
npx plccheck check ./my-plc-project
npx plccheck test ./my-plc-project
npx plccheck test ./my-plc-project --coverage-json coverage.json --coverage-lcov lcov.info
LLM-Assisted Review
Because the workflow is file-based, LLM tools can inspect PLC source, documentation, test cases, and command output directly. This is useful for explaining unfamiliar logic, drafting tests, reviewing diagnostics, and preparing refactors before changes are reintroduced into the TIA workflow.