- Home
- Skills
- Testing & Debugging
- plccheck — Siemens PLC programming
Works with the AI Agents you already use
plccheck — Siemens PLC programming
Write Siemens PLC code, test it locally, and move changes into TIA Portal.
Free
plccheck — Siemens PLC programming
Example session with this skill installed
Write a Siemens SCL motor start/stop latch. Stop must win when both inputs are true. Add tests for idle, start, latching, stop, and simultaneous inputs, then run them with plccheck. Include coverage and a ten-scan simulator run.
- Read your context and instructions
- Compiled the plccheck
Result
The motor starts on Start, stays running after Start is released, and stops on Stop. Stop takes priority. The code and five tests are included in assets/motor-demo.
Complete project
.plc.json
{"name":"Motor control demo","cpuFamily":"S7-1500"}
MotorControl.scl
FUNCTION_BLOCK "MotorControl"
VAR_INPUT
Start : Bool;
Stop : Bool;
END_VAR
VAR_OUTPUT
Running : Bool;
END_VAR
BEGIN
IF #Stop THEN
#Running := FALSE;
ELSIF #Start THEN
#Running := TRUE;
END_IF;
END_FUNCTION_BLOCK
Main.scl
DATA_BLOCK "Motor_DB" "MotorControl"
BEGIN
END_DATA_BLOCK
ORGANIZATION_BLOCK "OB1"
BEGIN
"Motor_DB"(Start := FALSE, Stop := FALSE);
END_ORGANIZATION_BLOCK
MotorControl.scltest
TEST_TARGET "MotorControl";
TEST_CASE "motor remains idle without a request"
SET UUT.Start := FALSE;
SET UUT.Stop := FALSE;
SET UUT.Running := FALSE;
WAIT_CYCLES 1;
ASSERT UUT.Running = FALSE;
END_TEST_CASE
TEST_CASE "motor starts on request"
SET UUT.Start := TRUE;
SET UUT.Stop := FALSE;
SET UUT.Running := FALSE;
WAIT_CYCLES 1;
ASSERT UUT.Running = TRUE;
END_TEST_CASE
TEST_CASE "motor stays latched after start is released"
SET UUT.Start := TRUE;
SET UUT.Stop := FALSE;
SET UUT.Running := FALSE;
WAIT_CYCLES 1;
ASSERT UUT.Running = TRUE;
SET UUT.Start := FALSE;
WAIT_CYCLES 2;
ASSERT UUT.Running = TRUE;
END_TEST_CASE
TEST_CASE "motor stops and stays stopped"
SET UUT.Start := FALSE;
SET UUT.Stop := TRUE;
SET UUT.Running := TRUE;
WAIT_CYCLES 1;
ASSERT UUT.Running = FALSE;
SET UUT.Stop := FALSE;
WAIT_CYCLES 2;
ASSERT UUT.Running = FALSE;
END_TEST_CASE
TEST_CASE "motor stop wins over simultaneous start"
SET UUT.Start := TRUE;
SET UUT.Stop := TRUE;
SET UUT.Running := FALSE;
WAIT_CYCLES 1;
ASSERT UUT.Running = FALSE;
END_TEST_CASE
Test results
Run with plccheck 2.19.0 and Go 1.26.5 on Windows.
| Check | Observed result |
|---|---|
| Static check with warnings enabled | Passed; no diagnostics |
| Behavior tests | 5 of 5 cases passed |
| MotorControl.scl source coverage | 6/6 statements, 3/3 branches, 1/1 functions |
| Bounded whole-program simulator run | 10 scans completed; exit code 0; OPC UA disabled |
The coverage numbers are for MotorControl.scl. The unit tests do not cover OB1; the separate ten-scan run checks that the whole program builds and runs.
Run it yourself
Copy assets/motor-demo from the ZIP into ./motor-demo, then run:
npx --yes plccheck@2.19.0 check --show-warnings ./motor-demo
npx --yes plccheck@2.19.0 test ./motor-demo --coverage-json coverage.json --coverage-lcov lcov.info
npx --yes plccheck@2.19.0 run ./motor-demo -- --cycles 10 --opcua-port 0
The OB call uses fixed inputs for the demo. Connect it to your project’s signals and add whole-program tests before using it in an application. This is ordinary control logic, not a safety-rated stop.
Connects securely to your tools. The creator never sees your data.
About this skill
Use plccheck to write and test Siemens PLC programs from your coding agent. Work with an existing TIA Portal project or build and run PLC logic locally without a controller.
The skill covers SCL/Structured Text and S7DCL exports with FBD and LAD networks. It tells the agent how to find the right PLC workspace, check code, write .scltest tests, and run them. For TIA projects, it covers export, import, and compilation, including how to handle conflicting edits and library-owned blocks.
The download includes:
- The skill instructions and separate guides for testing and TIA Portal.
- A small motor start/stop example with five tests.
- Codex display metadata and the license.
The example has been run with plccheck 2.19.0: all five tests pass, and a separate ten-scan run builds and executes the whole program. The demo includes the full source and commands.
You need Node.js/npm and the plccheck CLI. Tests and simulation also need Go 1.24+. The CLI runs on Windows, Linux, and macOS; TIA Openness needs Windows x64 and TIA Portal Openness V21+. Install these separately. VS Code is optional—the screenshot shows the companion extension.
The simulator runs generated Go code. It is useful for testing logic, but does not reproduce Siemens CPU timing or support every instruction. Passing tests does not replace validation on the target controller.
Free to download under CC BY-NC 4.0. Contact the maintainer for commercial-use permission.
The simulator runs generated Go code, not a Siemens CPU. Timing can differ, and some instructions and library blocks are unsupported. TIA Openness needs Windows and installed Siemens software. The download includes the skill and example source, not the required software or Siemens licenses.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 26 days ago
- Free with an Agensi account
Requires
Permissions
File Scopes
Reads and edits the selected PLC project and runs plccheck commands. First-time setup may download npm and Go packages. TIA connections and credential environment variables are only needed for TIA workflows. Downloads to a PLC and other online changes need the user’s authorization for that controller. No cloud account is required.