Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Unresolved generic CFC block output

A generic block like ADD<T1: ANY_NUM, T2: ANY_NUM> : T1 — where IN1 binds T1, the remaining variadic inputs bind T2, and the output is typed T1 — has no types of its own: every call must resolve the bindings to concrete types, and in a CFC network they are inferred from the block’s wired inputs. Feeding generic outputs back into generic inputs is ambiguous: each side waits on the other and the binding could be anything, so nothing ever decides it.

        ADD
      +---------------+
 .--> | IN1       ADD | --+--> acc
 +--> |               |   |
 |    +---------------+   |
 '------------------------'   [output feeds back into every input]

Wire at least one input to a concretely typed source — a variable, a literal, or the output of a non-generic block:

        ADD
      +---------------+
x --> | IN1       ADD | --+--> acc     [x : DINT decides T1 = DINT]
 .--> |               |   |
 |    +---------------+   |
 '------------------------'

Routing a feedback loop through a declared variable also resolves it: the variable’s declared type decides the generic binding.