Sources

ExternalInput Block

Injects an externally controlled value into the simulation. Use for sensors, HMI sliders, or scripted inputs.

Open ExternalInput in BlockWerk →

# ExternalInput Block

Description

ExternalInput is a source block that injects a scalar numeric value into the simulation through a named channel. During an active simulation the block renders an editable input field directly on the canvas, allowing the value to be changed in real time without stopping the run. External code (e.g. a plugin, an automation script, or another BlockWerk integration) can also push values to the same channel by ID.

Use this block wherever a simulation needs a live, user-controlled or externally driven scalar: HMI setpoint sliders, scripted test profiles, hardware sensor overrides, or any value that should be adjustable without editing block parameters.

Parameters

channelId

Unique string identifier for this input channel. External code and the simulation engine address this block by this ID. Default: sensor1.

defaultValue

Numeric value used when no external value has been set and the simulation is idle. This parameter is tunable (can be adjusted via the Properties panel during an active simulation). Default: 0.

unit

Optional display-only label appended beneath the value on the block face (e.g. rpm, °C, m/s). Has no effect on the signal value. UI-only field.

Examples

Manual setpoint control during a live PID simulation

ExternalInput ──► [out] ──► PIDController → [ref]
  channelId:    setpoint
  defaultValue: 50
  unit:         %

Inject a scripted ramp from external code

// From a plugin or the browser console:
store.setExternalInput('ramp_cmd', currentValue);
ExternalInput ──► [out] ──► Plant
  channelId: ramp_cmd

Remarks

See Also