Verified: Function Block Diagram
Each claim the Function Block Diagram page makes, with the tests that
prove it in the last green CI run: 29 of 30 verified.
The claims live in docs/claims/function-block.yaml.
Last green CI run 16 Oct 2026, 14:48 UTC on c7618d3 · all runtime claims
FBD-001 verified
An .fbd body is a netlist of named wires, coils, and function-block instances inside an ordinary ST POU; everything before FBD and after END_FBD is plain ST.
FBD-002 verified
A coil writes a variable; the target may be an array element or struct member (TempHist[1] := TempC), and array/struct accessors work as inputs.
FBD-003 verified
An FB instance is declared and called in one statement (lic : PID(...)); lic : PID alone declares it and lic(PV := ...) calls it later; lic.CV reads an output pin.
- pass
TestFunctionBlockInstanceinlang/fbd - pass
TestTranspileMultipleBlocksinlang/fbd - pass
TestConformance/fb-toninlang/conformance(7 of 7 passed) - pass
TestSplitDeclareThenCallinlang/fbd - pass
TestInlineInstanceNotHiddenByLibraryBlockVarinlang/fbd(4 of 4 passed)
FBD-004 verified
The => output binding (ET => Elapsed) captures a non-BOOL pin into a variable.
- pass
TestOutputBindinginlang/fbd
FBD-005 verified
Inline NOT negates a pin; constants (5.0, T#10S, TRUE, 'ok') are literal inputs.
FBD-006 verified
Statements may end with ; or just a newline, and full-line // comments are allowed in the body.
FBD-007 verified
A standard function's inputs are positional (LIMIT(0.0, x, 9.0)) or all named by their standard names (LIMIT(MN := 0.0, IN := x, MX := 9.0)).
- pass
TestArithmeticAndFanoutinlang/fbd - pass
TestConformance/fbd-en-eno/EN TRUE runs the call and ENO is TRUEinlang/conformance - pass
TestENOErrorsinlang/fbd - pass
TestAllNamedStandardCallWithoutENinlang/fbd
FBD-008 verified
Compilation transpiles the netlist to ST and runs it through the ST front end, so errors map back to the exact .fbd line.
- pass
TestTranspileLineMapinlang/fbd - pass
TestCheckReportsIdentifierColumnincmd/naut - pass
TestAnalyzeFBDMapsDiagnosticsToSourceininternal/lsp
FBD-009 verified
A wire is a pure combinational expression inlined at every read, so fan-out duplicates an expression rather than creating shared state.
FBD-010 verified
Wires must be acyclic: a wire that reads itself, directly or through another wire, is a compile error ("combinational loop through wire").
FBD-011 verified
A variable read early in the body carries the value its coil wrote on the previous scan, so HighLevelAlm := AND(OR(above, HighLevelAlm), NOT below) is a seal-in latch.
- pass
TestSealInLatchinlang/fbd - pass
the high-level alarm latches at 90% and clears only at or below 85%inexamples/lift-station
FBD-012 verified
Statements evaluate in source order, except that a function-block call is emitted ahead of any statement that reads its output pins, so lic.CV reads this scan's result wherever lic sits in the file.
FBD-013 verified
A body can be divided into NETWORKs; network 1 runs to completion, then network 2, and the FB-before-reader rule holds within a network only, so a read of a later network's FB output sees the previous scan's value.
FBD-014 verified
Statements before the first NETWORK line are an untitled first network, and a body with no NETWORK line is one network.
FBD-015 verified
Any block takes EN (BOOL, TRUE when unbound) and gives ENO; while EN is FALSE a function's result is not written (its variable keeps its value) and a function block's outputs and internal state hold.
- pass
TestConformance/fbd-en-enoinlang/conformance(8 of 8 passed) - pass
TestENOFunctionGatesItsCoilinlang/fbd - pass
TestENOModelAndTranspileinlang/fbd
FBD-016 verified
ENO is EN AND no error; DIV and MOD report a zero divisor through ENO.
- pass
TestConformance/fbd-en-eno/DIV's ENO is FALSE on a zero divisor, TRUE otherwiseinlang/conformance - pass
TestConformance/fbd-en-eno/DIV with EN FALSE holds its result and reports ENO FALSEinlang/conformance - pass
TestENOModByZeroinlang/fbd
FBD-017 verified
A block with EN/ENO must drive a variable (a coil, directly or through its named wire), and its ENO reads like a pin (t1.ENO, sp.ENO).
FBD-018 verified
While EN is FALSE a function block does not run: its outputs and internal state hold.
- pass
TestConformance/fbd-en-eno/an FB with EN FALSE does not run — edges it misses are not countedinlang/conformance - pass
TestConformance/fbd-en-eno/the FB's edge memory is stale while disabled — a rise across it counts on returninlang/conformance
FBD-019 verified
AND, OR, XOR, ADD and MUL take two or more inputs; SUB, DIV, MOD and the comparisons take exactly two; MOVE is a one-input pass-through.
- pass
TestFunctionAritiesinlang/fbd
FBD-020 verified
An FB input left out of the call keeps its value (its declared initial value until something writes it).
FBD-021 verified
User-defined TYPE structs work as inputs and coil targets.
FBD-022 verified
A user FUNCTION_BLOCK instantiates in FBD the way a TON does, whether authored in an ST, FBD or ladder library file; a .fbd/.ld/.st file with no PROGRAM is a project library.
FBD-023 verified
A controller running an FBD program serves and accepts the .fbd text; a warm swap migrates retained state by name and type, so a PID's integral or a running TON keeps its value.
FBD-024 verified
An .fbd download behaves as a .st one does: a failed compile leaves the running program untouched.
- pass
TestSwapWarmFBDCompileErrorLeavesRunninginruntime
FBD-025 verified
An edit routes to a task by PROGRAM name, so a task's own .fbd downloads without disturbing another task's program.
- pass
TestProgramFBDServedAndRoutedByPOUinserver
FBD-026 verified
Authoring a FUNCTION in FBD is not supported; functions are ST.
- pass
TestCheckRejects/FBD_FUNCTIONincmd/naut
FBD-027 partly verified
There are no execution-order overrides and no control flow (IF, CASE, loops) in the netlist.
FBD-028 verified
Inline arithmetic in an array index is not supported; the index is computed on a named wire first.
- pass
TestCheckRejects/FBD index arithmeticincmd/naut
FBD-029 verified
Defining the same wire twice is a compile error.
- pass
TestCheckRejects/FBD duplicate wireincmd/naut
FBD-030 verified
A wire that feeds itself is a compile error.