53 lines
2.4 KiB
YAML
53 lines
2.4 KiB
YAML
# Example FAT scenario for a pump-station PLC program.
|
|
#
|
|
# With a REAL PLC under test: run `wago-sim serve` against this node
|
|
# configuration; the PLC drives the outputs and the scenario asserts on
|
|
# them. Remove the `plugins:` line below — the PLC is the plant.
|
|
#
|
|
# Headless (no PLC): the plugins line loads an emulated plant model so
|
|
# the scenario can be smoke-tested end-to-end before the FAT bench is
|
|
# wired.
|
|
|
|
name: pump_station_fat
|
|
description: "Basic FAT round: start button -> pump relay -> valve -> level ramp"
|
|
|
|
plugins: [plugins.pump_plant.pump_plant] # remove when a real PLC is connected
|
|
|
|
inputs: # simulated field signals (what the PLC reads)
|
|
# module-based addressing: module slot and
|
|
# channel number on the module, both 0-based
|
|
start_button: { type: di, module: 0, channel: 0 } # DI0.0
|
|
em_stop_ok: { type: di, module: 0, channel: 1 } # DI0.1
|
|
level_sensor: { type: ai, module: 4, channel: 0, scale: 0.1 } # AI4.0, level mm -> counts
|
|
|
|
outputs: # PLC outputs observed by the scenario
|
|
pump_relay: { type: do, module: 2, channel: 0 } # DO2.0
|
|
valve_open: { type: do, module: 2, channel: 1 } # DO2.1
|
|
speed_setpoint: { type: ao, module: 5, channel: 0, scale: 0.1 } # AO5.0
|
|
|
|
macros:
|
|
pulse_start:
|
|
- set: { start_button: ON }
|
|
- wait: 250ms
|
|
- set: { start_button: OFF }
|
|
|
|
sequence:
|
|
# --- startup checks -------------------------------------------------------
|
|
- set: { em_stop_ok: ON }
|
|
- assert: { label: "pump idle", conditions: { pump_relay: OFF }, within: 1s }
|
|
|
|
# --- start sequence ---------------------------------------------------------
|
|
- macro: pulse_start
|
|
- assert: { label: "pump starts", conditions: { pump_relay: ON }, within: 2s }
|
|
- assert: { label: "valve opens", conditions: { valve_open: ON }, within: 2s }
|
|
|
|
# --- process dynamics -------------------------------------------------------
|
|
- ramp: { name: level_sensor, to: 8500, over: 30s }
|
|
- wait: 31s
|
|
- assert: { label: "speed setpoint raised", conditions: { speed_setpoint: ">= 1000" }, within: 3s }
|
|
|
|
# --- stop sequence ------------------------------------------------------------
|
|
- set: { em_stop_ok: OFF }
|
|
- assert: { label: "safe state on e-stop", conditions: { pump_relay: OFF, valve_open: OFF }, within: 2s }
|
|
|
|
- report: PASS |