Generated reference › Parameter Writer — Control Systems/Signal Routing
kind: generated#block#control-systems-signal-routing

Parameter Writer — Control Systems/Signal Routing

p

Control_Systems/Signal_Routing/Parameter_Writer · 1 input / 0 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, 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.

Parameter Writer

Control Systems / Signal Routing

Writes its input into a parameter of another block – its owner, named by path – on every step, with no wire between the two: a Gain’s gain, a Constant’s value, a Saturation’s limits. The writer always runs before its owner, so the owner computes with the written value in the same step. Nothing persists: the next run starts from the parameter’s configured value again.

Ports

  • Input u – the value written, of the parameter’s size: a Gain’s or Constant’s value as configured, one value for a Saturation limit. Any other size stops the run at the first write.
  • No outputs.

Parameters

  • Parameter owner block – the full path of the block written, as the navigator shows it (Home/Plant/Gain). It follows the block when that block or a subsystem above it is renamed or moved.
  • Parameter name – which parameter, in Simulink’s name for it, which is case-sensitive: Gain on a Gain (its Gain Value), Value on a Constant (its Constant Value), and UpperLimit or LowerLimit on a Saturation. Those are the parameters ICore can change while a model runs; any other block or name is refused.
  • Destination – Block parameter, the only one ICore writes. Simulink’s Model workspace variable and Base workspace variable write a workspace variable instead, which a run here has no copy of; either is refused by name.
  • Sampling Time (s) – zero or less writes on every step of the model; a positive value writes at that period. It does not cross to Simulink, whose Parameter Writer has no rate parameter.

When a run is refused

No owner named (as Simulink: does not have a parameter owner block), an owner that is not in the diagram, a parameter the owner does not have or cannot have written (Simulink: does not have a parameter with name …), a destination other than Block parameter, and a path from the owner back to the writer with no delay in it (an algebraic loop through the write, which Simulink refuses too). A written value of the wrong size, or a Saturation upper limit written below its lower one, stops the run when it is written.

Code export

Python, MATLAB, Java, Rust, C, C++ and PLC Structured Text: the owner’s parameter is a variable of the exported core, and the writer assigns it where it runs, before the owner reads it. VHDL, Verilog and SystemVerilog are not offered: a parameter there is a port or a constant of the design, which nothing inside it can write, so an export to one stops and names the block.

Simulink bridge

Import and export, mapped to simulink/Signal Routing/Parameter Writer. Parameter owner block ↔ ParameterOwnerBlock, written as the full path Simulink requires and set once every block exists; an owner outside the exchanged subsystem cannot cross and is reported. Parameter name ↔ ParameterName and Destination ↔ Destination. Simulink’s WorkspaceVariableName and IsParameterValidationOn are not carried: ICore always checks a write.

Notes

  • Simulink refuses a Constant owner at its default sample time (inf): give the Constant a rate before exporting a model where one is written.
  • Two writers of one parameter on one step: the last one to run wins.

Code facts#

FactValue
registered typeControl_Systems/Signal_Routing/Parameter_Writer
familyControl_Systems/Signal_Routing
solver environment classICoreBlock_0_Control_Systems_1_Signal_Routing_2_Parameter_Writer
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Signal_Routing/Parameter_Writer/ICoreBlock_0_Control_Systems_1_Signal_Routing_2_Parameter_Writer.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Signal_Routing/Parameter_Writer/ICoreBlock_0_Control_Systems_1_Signal_Routing_2_Parameter_Writer.h
default size on canvas60 × 60 px
ports at insert1 in, 0 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoubleu

Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.

Configuration variables#

Config variableDefaultSimulink parameter
Parameter owner block—ParameterOwnerBlock
Parameter name—ParameterName
DestinationBlock parameter%~%Model workspace variable%~%Base workspa…Destination

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.

supportSupport::Both
Simulink pathsimulink/Signal Routing/Parameter Writer
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
deliberately not crossedIsParameterValidationOn, WorkspaceVariableName
ICore configSimulink parameterValue translation
Parameter owner blockParameterOwnerBlockpasses through
Parameter nameParameterNamepasses through
DestinationDestinationBlock parameter → Block parameter, Model workspace variable → Model workspace variable, Base workspace variable → Base workspace variable

Caveat (shown to the user): Simulink's Parameter Writer has no SampleTime; the parameter name is Simulink's own on both sides; IsParameterValidationOn and WorkspaceVariableName are not carried

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:

  • B0 no 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).

Parameter Writer -- writes its input into another block's parameter, each step Measured on R2026a (FEATURES_TO_ADD.md §F.BF11, BF11.1): BlockType=ParameterWriter, 1 in / 0 out, ParameterOwnerBlock (a full path), ParameterName (Simulink's name for the parameter, case-sensitive: 'gain' is refused), WorkspaceVariableName, IsParameterValidationOn, Destination {Block parameter, Model workspace variable, Base workspace variable}; no SampleTime. The writer sorts before its owner and the write lands in the same step: a Gain of 2 written t+1 gives y = [1 2 3 4 5]. Nothing persists past the run. Unit Delay is refused as an owner ("Block of type 'UnitDelay' cannot be a parameter owner block").

The engine is BF11.4 (tunable configs, ICoreModelSimulator::writeTunableConfig) and BF11.6 (the hard order edge, the same-step write from inside a solve, the bridge's block path); the table of what can be written, and the export, are ICoreParameterWriteExport.

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.