Skip to content
SCL unit tests for Siemens PLCs
Releasing soon
Unit testing for TIA Portal

SCL unit tests for Siemens PLCs

PLCSIM Advanced · S7-1200/1500 · CI/CD · AI-authored — and more
Write, run and evaluate SCL unit tests for your TIA blocks — against PLCSIM Advanced or real hardware, with AI authoring and CI/CD.

What SCL unit testing in Studio does

01

Arrange · Act · Assert

Define inputs, let the PLC cycle, check the outputs — as a visual form, JSON or generated SCL.
  • Visual editor & JSON
  • 20+ assertion operators
  • Multi-step (write/wait/assert)
02

PLCSIM Advanced & real PLC

Test against a virtual PLCSIM Advanced instance or straight against real S7-1200/1500 hardware.
  • PLCSIM Advanced V3.0+
  • S7 Native & OPC UA
  • Safety prompt before hardware runs
03

AI-authored test suites

The AI assistant derives full test suites from the block interface — boundary values included.
  • From the block interface
  • Boundary-value generation
  • Editable straight from chat
04

CI/CD & reports

The tia-test-runner command-line tool runs in GitLab, Jenkins & co. — with HTML and JUnit reports.
  • JUnit XML & HTML
  • rerun-affected
  • Pipeline-ready
05

History & trends

Every run is persisted — compare runs, spot flaky tests and track pass rate over time.
  • Run history & diff
  • Flaky detection
  • Trend charts & CSV export
06

No open TIA Portal needed

Write and run tests without keeping the TIA Portal window open — interface read from an exported copy.
  • Offline authoring
  • Paths never stored in clear text
  • Check in suites without secrets

SCL unit testing for TIA Portal — guide

A unit test in TIA Portal checks a single PLC block (FB/FC) in isolation: write defined inputs (Arrange), let the controller run a few cycles (Act) and check the outputs against expected values (Assert). The test runs against PLCSIM Advanced or a real S7 PLC — automated, repeatable and in CI/CD.

How does an SCL unit test work?

AnyAutomation Studio reads your block's interface straight from the TIA project so inputs and assertions validate against the real parameter names and types. A test suite is a .tia-tests/*.json file next to your project file. Each test case follows Arrange → Act → Assert: write values, wait cycles, check results. The runner creates the PLCSIM instance, compiles, connects, writes inputs, reads outputs and evaluates the assertions.

Against PLCSIM Advanced or real hardware

By default a suite runs against a PLCSIM Advanced instance — fast and without physical hardware. Via S7 Native or OPC UA you test straight against a real S7-1200/1500. A safety prompt appears before every run on real hardware, and the runner checks the controller is in RUN before it writes. Full configuration is in the unit testing documentation.

Studio vs. Siemens Test Suite

Siemens Test Suite (Advanced) is deeply integrated into TIA Portal and strong for certified acceptance workflows. AnyAutomation Studio takes a different angle: lightweight, scriptable SCL unit tests that fit your version control and CI/CD — Git diffs of the suites, AI-authored cases, trend reports and a command-line runner for the pipeline. If you want to test PLC code like software rather than sign off once, that is the difference. See also TIA Portal Test Suite alternative.

Frequently asked questions

What is a unit test in TIA Portal?

A unit test checks a single PLC block in isolation following Arrange/Act/Assert: set inputs, let the controller cycle, check outputs against expected values — against PLCSIM Advanced or a real S7 PLC.

Can I test against real S7-1200/1500 hardware?

Yes. Over an S7 Native or OPC UA connection a suite runs straight against the real controller. A safety prompt appears before the run, and the runner only writes when the PLC is in RUN.

Do I need an extra Siemens license for unit tests?

For PLCSIM Advanced runs you need a PLCSIM Advanced license from Siemens. The SCL unit testing itself ships with AnyAutomation Studio from the Pro tier — no Test Suite Ultimate license required.

Does it run in CI/CD?

Yes. The tia-test-runner command-line tool runs suites in GitLab CI, Jenkins and similar pipelines and produces JUnit XML and HTML reports. --rerun-affected runs only suites whose block changed.

Can the AI generate test suites?

Yes. The AI assistant derives test cases and boundary values from the block interface and writes them into the .tia-tests folder — editable straight from chat.

Start SCL unit testing

Describe your block → we'll show the test suite.