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
- Source block: Produces a single numeric output port on the right side. Has no input ports.
- Default value when idle: When the simulation is not running, the block always outputs
defaultValue. The editable input field only appears during an active or paused simulation. - Channel namespace: Channel IDs are global within a project. If two ExternalInput blocks share the same
channelId, both will reflect the same value. remote:prefix: Channel IDs beginning withremote:are highlighted on the block face and indicate a value fed from a RemoteSensor connection rather than manual entry.- Tunable default:
defaultValuecarries thetunable: trueflag, so it can be changed live from the Properties panel while the simulation is running.
See Also
- RemoteSensor: Source block for phone sensor data, which can feed ExternalInput channels using the
remote:channel prefix convention. - MQTTSubscriber: Source block for network-delivered values via MQTT broker.