pySimBlocks.blocks.interfaces.external_output

class pySimBlocks.blocks.interfaces.external_output.ExternalOutput(name: str, sample_time: float | None = None)[source]

Bases: Block

External output interface block.

Pass-through block for exposing model signals to the real-time external side. Accepts scalar, (n,) or (n,1) inputs and forwards them as a strict (n,1) column vector. The output shape is frozen after the first non-None input and cannot change during the simulation.

direct_feedthrough = True

True if outputs depend directly on inputs.

initialize(t0: float) None[source]

Set the output to None if no input is available, or forward the input.

Parameters:

t0 – Initial simulation time in seconds.

output_update(t: float, dt: float) None[source]

Forward the input to the output as a column vector.

Parameters:
  • t – Current simulation time in seconds.

  • dt – Current time step in seconds.

Raises:
  • RuntimeError – If input in is not set.

  • ValueError – If the input shape is incompatible or has changed.

state_update(t: float, dt: float) None[source]

No-op: ExternalOutput carries no internal state.