TwinCAT 3 · Track 13 · the laptop dress-rehearsal

Simulation & Digital Twin

Use this browser model to trace a glazing sequence, inspect its signals and provoke a stuck valve. Then work through what changes when you test your own PLC project in TwinCAT XAE and a compatible XAR runtime. This page runs JavaScript; it does not install, connect to or execute the Beckhoff runtime.

Browser model · no PLC connection🍩 a virtual machine⏩ faster than real life
01 · The living line

One machine, watched three ways at once

Watch the donut, signal lamps and highlighted code move together. The displayed Structured Text explains the sequence; JavaScript advances the model. The scan counter represents simulated time at a nominal 1 ms interval, not measured PLC executions or browser timing. Use Step to inspect a model update, and Jam the valve to separate a command from its physical effect.

STOP · task halted
glaze on the floor: 0 g
GLAZE
Live I/O · the process imagetask
bDonutAtStation FALSE
bGlazeComplete FALSE
bConveyor FALSE
bGlazeValve FALSE
model cycles 00 donuts glazed
The task · Structured Text, every cycle
L1 IF NOT bDonutAtStation THEN bConveyor := TRUE; bGlazeValve := FALSE; END_IF
L2 IF bDonutAtStation AND NOT bGlazeComplete THEN bGlazeValve := TRUE; bConveyor := FALSE; END_IF
L3 IF bGlazeComplete THEN bGlazeValve := FALSE; bConveyor := TRUE; END_IF
speed

👀 Watch the link: when bDonutAtStation flips TRUE, line L2 lights, bGlazeValve goes green, and only then does glaze pour. Machine, signals, and Structured Text are never out of step — because they are all the same task. That is what "running in simulation" actually feels like. Hit ⏭ Step to advance one slice at a time, exactly like single-cycle mode in the online view.

02 · How TwinCAT fakes the world

Choose a target and define its I/O

A real TwinCAT project needs a selected target, a compatible runtime, a task configuration and an explicit source for its inputs. The comparison below illustrates those choices; its buttons do not activate hardware. A local PLC runtime does not automatically create an EtherCAT plant model. Beckhoff provides separate EtherCAT simulation tooling for that job.

⚙️ Activate this project onto…
Config Mode 🟦 → Run Mode 🟩
Your engineering PC · XAE
📦 The boot project
PLC project · configured task
GVLs · libraries · test I/O
check target compatibility
Activate
Configuration
→
Chosen target
💻 Local Runtime
runs on this laptop

Local runtime test. Install and configure a supported runtime, select the target and configure the project for the intended I/O model. Follow the documentation for your TwinCAT build and licence. This page makes no connection to that runtime.

What to verify. Confirm the selected target, task interval, ADS route and input/output mappings. Runtime availability and licensing depend on the installation. Do not assume an example AmsNetId is the correct address of your machine.

03 · The cheap mistake

You just broke a machine and it cost nothing

Go back up and hit ⚡ Jam the valve. Watch it: bGlazeComplete goes TRUE, line L3 tries to shut the valve — but it's stuck open. The donut drowns, the glaze counter climbs, the line faults out. Now picture that on the real floor: pink syrup over a machine, a stopped line, a very sticky afternoon and a maintenance callout. Here it is a number you reset with a button.

🐛
Compare command and feedback
Jam the valve after glazing starts. The close command changes but the model keeps spilling. Record the first signal that distinguishes a failed actuator from a logic mistake. The model has no real valve-position sensor: identify the feedback you would need on a machine.
€0
🔁
State your test boundary
This model checks a short sequence. It does not execute your PLC program, emulate an EtherCAT network or validate drive timing. Passing here is an explanation of the sequence, not evidence that a CX controller will meet its deadlines.
read→solve→write
⏩
Use speed to inspect a scenario
Run the same jam at 1× and 20×. The event order should be understandable at both speeds. Wall-clock timing in a browser is affected by rendering and background-tab throttling; measure actual task execution on the chosen runtime.
20×
🧯
Turn the observation into a test
Write down initial state, injected fault, expected output and recovery condition. Repeat the test in your actual project, including loss of feedback and restart. Simulation results do not replace the machine risk assessment or required safety validation.
no risk
04 · The real vocabulary

"Simulation" and "twin" aren't the same word

Use the buttons to compare test boundaries: software-only logic tests, physical-controller tests and models associated with real assets. Each answers different questions; adding hardware alone does not make a test complete.

Closed-loop inputs can be part of ordinary software-in-the-loop testing. That alone does not make a digital twin. A twin represents an identified real asset and needs a defined relationship to its operational data, assumptions and model accuracy.

05 · Check yourself

Two that separate the pros

1 · You have no controller on your desk, only the TwinCAT IDE on your laptop. How do you run and test the actual task today?

2 · Your virtual line glazed a donut, the photo-eye tripped on its own, and the valve opened — all with no clicking from you. Which setup were you running?

From this model to a TwinCAT test record

  1. List the input and output variables used by your sequence and identify which will come from a test harness instead of a terminal.
  2. In your isolated test project, select the intended runtime target. Record its TwinCAT build, runtime mode and configured task interval. Confirm licensing and compatibility against the documentation for that installation.
  3. Choose PLC-level I/O substitution or an EtherCAT simulation setup deliberately. TE1111 is dedicated tooling; selecting a local target does not create it.
  4. Test normal filling, stuck-open output, missing station feedback and restart after the fault. Capture expected versus observed state transitions and task diagnostics.
  5. Carry the remaining hardware-dependent checks into commissioning: actual I/O latency, electrical faults, actuator response and the separately validated safety functions.

For the contrasting simulator workflow, see Sysmac Studio simulation. For the general sequence rather than a vendor setup, use the timer and CASE model.

Manufacturer references

These references describe Beckhoff software. The exercise above is an independent TryPLC educational model; no hardware test or manufacturer certification is claimed.