Callback Button — Control Systems/Dashboard
Control_Systems/Dashboard/Callback_Button · 0 input / 0 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text
Description#
The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.
Callback Button (Dashboard)
Control Systems / Dashboard
A button on the canvas that runs a project script when it is clicked. It
holds no value, watches no signal and puts nothing on a wire: a click runs the script
named by Click Script from the project's scripts/ folder, exactly
as run <name> typed at the console would. It has no ports at
all.
Ports
- None. Not one input, not one output. A click is the block's only input, and running a script its only output.
The click
A short left click on the button selects it, as on any block, and then runs the
script; dragging the button moves it and runs nothing, and a right click runs
nothing. The script runs in the console workspace, with no trust prompt – it is
the project's own. Clicks work while a simulation runs, but a script cannot steer
that run: simulate is refused while one is live, and a block reads its
configuration once per run.
Nothing runs, and a warning titled with the block's name says why, when the name is empty, when a script is already running in the Script IDE, or while code export is reading the model. A script that fails is reported the same way.
Parameters
- Click Script – the name of the script to run, as
runtakes it:reset_plantrunsscripts/reset_plant.icore. Empty runs nothing. It names a script, not a variable, so it is never looked up in the variables space. - Button Text – the text on the button, default Callback Button, Simulink's.
- Sampling Time (s) – unused: the block takes no part in a run. Zero or less inherits the solver's rate.
Notes
- Stateless, and not a terminal: it consumes nothing, so a run passes it by.
- Simulink's
PressFcn– code run while the button is HELD, with itsPressDelayandRepeatInterval– has no counterpart here: the canvas reports a click, not a press.ButtonType(momentary or latched) is therefore not offered either.
Code export
All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text. A deployable core has no canvas to click, so each one emits a comment saying so, inside the target's empty block body – the export never fails because of this block, and its signals are untouched.
Code-export verification
This block is excluded from the code-export verification matrix, by name: it has no ports and computes nothing, so there is no signal to record or compare on either side.
Simulink bridge
None. Simulink's Callback Button
(BlockType=CustomCallbackButton, measured on R2026a: zero ports, no
SampleTime) runs ClickFcn, which is MATLAB code executed by
Simulink's editor; this block runs an ICore console script. The two are different
languages, so neither crosses, and the block is reported on exchange.
Code facts#
| Fact | Value |
|---|---|
| registered type | Control_Systems/Dashboard/Callback_Button |
| family | Control_Systems/Dashboard |
| solver environment class | ICoreBlock_0_Control_Systems_1_Dashboard_2_Callback_Button |
| source | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Dashboard/Callback_Button/ICoreBlock_0_Control_Systems_1_Dashboard_2_Callback_Button.cpp |
| header | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Dashboard/Callback_Button/ICoreBlock_0_Control_Systems_1_Dashboard_2_Callback_Button.h |
| default size on canvas | 120 × 48 px |
| ports at insert | 0 in, 0 out |
| code generators implemented | Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text |
Ports#
The constructor creates no port explicitly — the port list comes from registerInitialPorts (0 in, 0 out) or from the block's configuration.
Configuration variables#
| Config variable | Default | Simulink parameter |
|---|---|---|
Click Script | — | — |
Button Text | Callback Button | — |
Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.
Simulink bridge#
| support | Support::None |
| Simulink path | — |
| port-count rule | PortsParam::None |
SampleTime parameter | yes |
Caveat (shown to the user): Simulink's Callback Button (BlockType=CustomCallbackButton, measured on R2026a: zero ports, no SampleTime) runs ClickFcn, MATLAB code executed by Simulink's editor; this block runs an ICore console script from the project's scripts/ folder. The two are different languages, so neither the script nor the button crosses. PressFcn, PressDelay, RepeatInterval and ButtonType have no counterpart: the canvas reports a click, not a press
Catalog contract: src/ICoreBlocks/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h
Description vs code#
The checker has a blind spot here — it could not resolve something (a grouped port bullet, a computed config name), which is reported and never counted as a pass. A reader has to settle it:
B0no sample under docs/generated/samples/ — nothing to cross-check (P8.1)
The verdict above is
tools/docs/check_block_descriptions.py(P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.
File banner (developer view)#
The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).
Callback Button -- a button on the canvas that runs a project script when it is clicked It has no ports, holds no value and watches nothing: a click runs the script named by "Click Script" from the project's scripts/ folder, exactly as
run <name>typed at the console would, and that is the whole block. Its face is drawn (a button with "Button Text" on it) through ICoreBlock::setFaceDrawing, and the click arrives through ICoreBlock::setFaceClickHandler -- the frame calls it for the short left press-and-release that also selects the block, after the selection; a drag moves the block and clicks nothing (FEATURES_TO_ADD.md BF22.1). ICoreClickScript::run refuses by name, running nothing, while a script is already running in the Script IDE or code export holds the model, and shows a refusal or a failed script as a warning titled with the block (BF22.2).⚠ MEASURED, R2026a (simulink_hmi_blocks/Callback Button, 2026-10-02): BlockType= CustomCallbackButton, ZERO ports, no SampleTime. Its dialog shows only the label position and fixedAspectRatio; the rest is hidden parameters: ClickFcn and PressFcn (MATLAB code, both empty), ButtonText ("Callback Button"), ButtonType ("Momentary"), PressDelay (500) and RepeatInterval (0). ClickFcn is MATLAB code run by Simulink's editor; this block runs an ICore console script. Different languages, so nothing crosses the bridge: Support::None. PressFcn (code run while the button is held) has no counterpart -- the canvas reports a click, not a press -- and the description says so.
It is NOT a terminal: like the DocBlock it consumes nothing, so it declares neither setSinkBlock() nor setScopeBlock(), and every target's body is a comment.
Sample results#
No sample run is committed for this block. Samples come from the headless harness (DOCS_PLAN.md P8.1) into docs/generated/samples/; until one exists this block's behaviour is witnessed by the parity and export-verification suites, not by a plot here.