pySimBlocks.blocks.interfaces.bus_from

class pySimBlocks.blocks.interfaces.bus_from.BusFrom(name: str, tag: str, sample_time: float | None = None)[source]

Bases: Block

Read a signal from the global signal bus by tag.

BusFrom and Goto blocks implement a virtual wiring mechanism: a Goto writes its input to signal_bus._signal_bus[tag] each tick, and this block reads that value without requiring an explicit connection in the model graph.

The model’s topological sort injects a virtual edge from each Goto to every BusFrom sharing the same tag, ensuring the Goto executes before this block within the same tick.

direct_feedthrough = True

True if outputs depend directly on inputs.

initialize(t0: float) None[source]

Read the initial value from the signal bus if available.

If the tag is not yet in the bus (Goto not yet initialized), the output is set to None.

Parameters:

t0 – Initial simulation time in seconds.

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

Read the current value from the signal bus.

Parameters:
  • t – Current simulation time in seconds.

  • dt – Current time step in seconds.

Raises:

KeyError – If no Goto with the matching tag has written to the bus in this run.

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

No-op: BusFrom carries no internal state.