Skip to content

Write one conveyor control program in five IEC 61131-3 languages and pass a simulated plant test

Exact prompt

# Write one conveyor control program in five IEC 61131-3 languages `spec.json` gives the I/O names and addresses, the batch size, the jam time and how each input is wired. Write the same control program five times, once per language, each as a PROGRAM named `conveyor` that declares the I/O with exactly the addresses in `spec.json`: - Ladder Diagram (LD): `out/conveyor_ld.xml` - Function Block Diagram (FBD): `out/conveyor_fbd.xml` - Structured Text (ST): `out/conveyor.st` - Instruction List (IL): `out/conveyor.il` - Sequential Function Chart (SFC, textual form): `out/conveyor_sfc.st` LD and FBD are PLCopen TC6 XML 2.01 projects (`<project xmlns="http://www.plcopen.org/xml/tc6_0201">`) whose program body is `<LD>` or `<FBD>` respectively; ST, IL and SFC are plain IEC text files. Standard function blocks (R_TRIG, TON, CTU, ...) are allowed in every language. A CONFIGURATION is optional; without one, the bench runs `conveyor` in a 10 ms cyclic task. ## Behaviour - The motor runs once START is pressed and keeps running (latched) until something stops it. - It stops when STOP is pressed, when the emergency-stop chain opens, on a fault, or when the batch is done. Check the wiring in `spec.json`: STOP and the emergency-stop chain are normally closed. - Count a box each time the exit photo-eye goes from clear to blocked while the motor is running. When the count reaches the batch size, stop the motor and light the batch-done lamp. The count carries over when the belt is stopped and restarted; only RESET clears it (and the lamp). - Jam: if the photo-eye stays blocked for the jam time or longer while the motor runs, latch a fault. An open emergency-stop chain also latches the fault. The fault lamp shows the fault; the batch-done lamp is off while there is a fault. - RESET clears a fault only when the emergency-stop chain is healthy and the photo-eye is clear. While a fault or the batch-done state is active, START does nothing. ## Compiler notes (matiec) - Declare the located I/O in its own `VAR ... END_VAR` block, separate from internal variables. - In IL, a formal `CAL` puts each parameter on its own line: `CAL tmr(` / `IN := x,` / `PT := t` / `)`. `R` and `S` are IL operators, so set an instance's `R` or `S` input with `LD ...` / `ST inst.R` before `CAL inst`. Pass TIME values to a `CAL` through a variable, not as a literal. - In SFC, an action named after a BOOL variable (`STEP Run: MOTOR(N); END_STEP`) drives that variable only while the step is active. ## Test bench `python3 bin/plcsim.py <st|il|sfc|ld|fbd> <file> [scenario.txt]` compiles your file with the open-source matiec compiler (LD/FBD are first converted to ST with the Beremiz PLCopen generator), runs it scan by scan and prints `tick MOTOR FAULT BATCH_DONE` at the scenario's sample ticks. `scenario-sample.txt` and `scenario-sample-expected.txt` are a worked example. Scoring runs each file on a different, hidden scenario of the same kind and compares the outputs at settled sample ticks (never within 100 ms of a change), so one-scan timing differences between languages don't matter. A file that is missing, doesn't compile, or isn't written in its language fails its check. ## How this run works - Work on your own: nobody will answer questions in this task, and writing to `ask/` counts against the run. - Write only under `out/`. Create `out/` if it is missing. Inputs are synthetic; don't fetch anything from the network. - Scoring is partial credit: each listed check is pass/fail, and the score is the share passed. Numbers are compared to within 0.005 unless the task says otherwise.

Implement the same conveyor logic (latched start, normally-closed stop and safety chain, box counting to a batch size that survives a stop and restart, a jam timer, and a reset that only works when it is safe) in Ladder Diagram, Function Block Diagram, Structured Text, Instruction List and Sequential Function Chart. Each file is compiled with the open-source matiec compiler (graphical languages via the Beremiz PLCopen generator) and run scan by scan against a hidden plant scenario; one check per language. Original benchmark task written for usecaserank.com (not based on a specific public post). Headless, offline run on a reproducible fixture. Each run's notes say how its cost was measured (estimates are marked).

Success criteria: ld fbd st il sfc

Best model for this task so far: Claude Haiku 5.5 (effort default (no --effort flag) · thinking on) (success, $0.13, 44m).

Run this on another model

All runs (3)

100% pass rate across 3 eligible runs: 3 pass, 0 partial, 0 fail. Partial and failed runs are listed below with everything else.ⓘ

Runs for this use case
ModelCostTimeStep-insⓘAutonomyOutcomeTrustⓘDateCompare
AClaude Opus 5.5default · thinking on$0.7311m0Fully autonomouspassTrust 80%2026-10-21
AClaude Haiku 5.5default · thinking on$0.1344m0Fully autonomouspassTrust 80%2026-10-21
AClaude Sonnet 5.5default · thinking on$0.362m0Fully autonomouspassTrust 80%2026-10-21

Embed this result

A live badge for this use case. It links back here and updates as new runs are published.

UseCaseRank badge for Write one conveyor control program in five IEC 61131-3 languages and pass a simulated plant test

Get new runs and ranking changes weekly

Which models got better or cheaper on real tasks like this one.