Connect a virtual plant model to simulate physical actuator feedback automatically, and run .yaml test scenarios to verify sequence behavior end to end.
A plant model runs alongside the Simulator on every scan cycle, reading PLC output coils and updating sensor inputs automatically.
plant.yamlPlace a plant.yaml file in your project root to model standard industrial mechanics without writing code:
| Element | Description |
|---|---|
cylinders |
Pneumatic or hydraulic cylinders with travel times and end-of-stroke reed switches (is_retracted, is_extended) |
conveyors |
Belt or roller conveyors that move parts between optical sensors |
analogs |
Analog process variables (temperature, pressure, level) driven by actuator outputs |
counters |
Physical pulse generators and encoder feedbacks |
INITIAL_INPUTS |
Initial boolean and numeric sensor states at simulation startup |
plant/*.mjs)For multi-station lines with part tracking, magazines, or custom physics, create an ES module (.mjs) that exports INITIAL_INPUTS and a step(outputs, dt, inputs) function:
export const INITIAL_INPUTS = {
clamp_is_retracted: true,
clamp_is_extended: false,
};
export function step(outputs, dt, inputs) {
if (outputs.clamp_extend) {
return { clamp_is_retracted: false, clamp_is_extended: true };
}
return { clamp_is_retracted: true, clamp_is_extended: false };
}
Configure the plant path in Settings -> Emulation -> Plant Config Path (automationview.emulation.plantConfigPath) or reference it directly in a .yaml test scenario.
.yaml)Test scenarios automate input stimulus, wait conditions, and assertions against your project and plant model.
Create a .yaml file in your project tests/ folder:
name: "Task A1 — Full Sorting Cycle"
project: ".."
cycle_ms: 10
plant: "../plant/line.mjs"
max_time: 120s
steps:
- set: { start_button: true }
- wait: 100ms
- set: { start_button: false }
- wait_until: "sorted_total >= 1"
timeout: 30s
- assert: "sorted_metal == 1"
message: "First metal part should be routed to the metal chute"
- expect_active: [" Coordination.WaitPart"]
| Step Key | Example | Description |
|---|---|---|
set |
set: { start_btn: true, recipe_id: 2 } |
Set one or more input variables to specified values |
pulse |
pulse: { start_btn: 100ms } |
Set a boolean variable TRUE for the given duration, then FALSE |
force |
force: { sensor_a: true } |
Lock a variable to a forced value across scan cycles |
release |
release: [sensor_a] |
Release forced variables back to normal plant/sequence control |
wait |
wait: 500ms |
Advance simulation for a fixed duration (ms or s) |
wait_until |
wait_until: "done == true" |
Run simulation until the condition becomes TRUE (with optional timeout) |
assert |
assert: "count == 3" |
Verify that the expression evaluates to TRUE (with optional failure message) |
expect_active |
expect_active: ["Main.Idle"] |
Verify that the listed Sequence.StepName steps are currently active |
plantConfigPath