Generated reference › Data Type Conversion Inherited — Control Systems/Signal Attributes
kind: generated#block#control-systems-signal-attributes

Data Type Conversion Inherited — Control Systems/Signal Attributes

Control_Systems/Signal_Attributes/Data_Type_Conversion_Inherited · 2 input / 1 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.

Data Type Conversion Inherited

Control Systems / Signal Attributes

Converts one signal to the data type that another signal carries, and passes the result on – y = u, retyped to match ref. The reference exists to be asked about its type; its samples are never read, on either side of the bridge.

On this tree's signals the conversion changes no value, and the block says so rather than pretending otherwise. Every ICore wire carries a matrix of doubles, so the type on offer is always double, and a double converted to a double is itself. The output is therefore the signal input unchanged. This is exactly what Simulink's own block does when its reference is a double – which here it always is – so the block is a faithful restriction of it, not a simplification.

Ports

  • ref – the type reference. This is the FIRST input, which is the reverse of the obvious reading and was measured against R2026a rather than assumed. Any size [m,n]; its values are discarded, so nothing it carries can reach the output.
  • u – the signal to convert, the SECOND input. Any size [m,n].
  • Output – y, the same size and the same values as u. Its size follows u alone; the reference's size is not consulted.

Parameters

  • Rounding Method – how a value that does not land on the target type would be rounded: Ceiling, Convergent, Floor, Nearest, Round, Simplest or Zero. Defaults to Floor, as in Simulink. Inert here, measured: with a double reference there is no narrower type to round to, so every setting leaves the output identical. It is carried so that a model crossing the bridge keeps it.
  • Saturate On Overflow – on clamps a value at the target type's limits, off lets it wrap. Defaults to off, as in Simulink. Inert here, for the same reason: a double has no limits to reach.
  • Conversion Mode – Real World Value converts the value a signal stands for; Stored Integer reinterprets the raw stored number. Defaults to Real World Value. Inert here: with no scaling anywhere the two readings coincide.
  • Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period. This one is ICore's own: the Simulink block defines no sample-time parameter, so a rate set here stays on the ICore side and is reported rather than written into an exported model.

Code export

All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text. Every one of them emits a copy of the signal input and never touches the reference. None of the three parameters reaches the generated code: they select a conversion that does not happen, so emitting them would cost every target a branch that can never be taken. The three HDL targets are trivially synthesizable – there is no arithmetic to quantize.

Simulink bridge

Import and export, mapped to simulink/Signal Attributes/Data Type Conversion Inherited. "Rounding Method" maps to RndMeth (all seven values, one for one), "Saturate On Overflow" to DoSatur and "Conversion Mode" to ConvertRealWorld. All three are 1:1 and therefore lossless in both directions, so a model that arrives with a non-default setting leaves with it.

Note that this block's ConvertRealWorld values are Real World Value and Stored Integer, without the (RWV) and (SI) suffixes the plain Data Type Conversion block uses. That is measured, and it matters: setting a value a Simulink block does not accept is a hard error that aborts the generated script.

The Simulink block defines no SampleTime, so the bridge deliberately writes none – the same reason. A block configured with an explicit positive rate reports that the rate did not cross.

Notes

  • Algebraic, with no state: the output is the signal input, sample for sample.
  • The reference is consulted for its type and nothing else. A model that needs the reference's values wants a different block; nothing on this one can carry them.
  • Deliberately carries no state space, even though the identity is linear. Absorbing this block into a neighbour would erase a declaration the user made about the wire, and would have to account for a second input that contributes nothing – so model reduction reports it as unmergeable, the same choice Signal Specification makes.
  • To convert to a type named outright rather than one taken from a reference signal, use Data Type Conversion; that block does change values, rounding and clamping at the target type's limits.

Code facts#

FactValue
registered typeControl_Systems/Signal_Attributes/Data_Type_Conversion_Inherited
familyControl_Systems/Signal_Attributes
solver environment classICoreBlock_0_Control_Systems_1_Signal_Attributes_2_Data_Type_Conversion_Inherited
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Signal_Attributes/Data_Type_Conversion_Inherited/ICoreBlock_0_Control_Systems_1_Signal_Attributes_2_Data_Type_Conversion_Inherited.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Signal_Attributes/Data_Type_Conversion_Inherited/ICoreBlock_0_Control_Systems_1_Signal_Attributes_2_Data_Type_Conversion_Inherited.h
default size on canvas90 × 70 px
ports at insert2 in, 1 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoubleref
2inICoreDoubleu
3outICoreDouble—

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
Rounding MethodCeiling%~%Convergent%~%Floor%~%Nearest%~%Round%~%Simplest…RndMeth
Saturate On Overflowoff%~%on~~offDoSatur
Conversion ModeReal World Value%~%Stored Integer~~Real World ValueConvertRealWorld

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 Attributes/Data Type Conversion Inherited
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
ICore configSimulink parameterValue translation
Rounding MethodRndMethCeiling → Ceiling, Convergent → Convergent, Floor → Floor, Nearest → Nearest, Round → Round, Simplest → Simplest, Zero → Zero
Saturate On OverflowDoSaturoff → off, on → on
Conversion ModeConvertRealWorldReal World Value → Real World Value, Stored Integer → Stored Integer

Caveat (shown to the user): the reference input is consulted for its TYPE and its samples are discarded, on both sides; every ICore wire carries a matrix of doubles, so the type on offer is always double and the conversion changes no value -- which is what the Simulink block does with a double reference too. The three parameters are carried so a model keeps them across the bridge, and they are inert on this tree for the same reason the conversion is. Note the PORT ORDER: port 1 is the reference and port 2 the signal, measured in R2026a

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).

Data Type Conversion Inherited -- convert a signal to the type another signal carries y = u2, converted to the type of u1. Every ICore wire carries a matrix of doubles, so the type offered is always double, and converting a double to a double changes no value:

y = u2

See the header for why that is the FAITHFUL restriction of Simulink's block rather than a stub of it, and for the MEASURED port order -- port 1 is the reference, port 2 is the signal, which is the reverse of the obvious reading.

The three parameters are carried but inert, measured so in R2026a: with a double reference, RndMeth, DoSatur and ConvertRealWorld leave the output unchanged. They are kept as configs so a model crossing the bridge keeps them rather than losing them silently on the way.

All ten exports copy port 1 (the ICore port INDEX of the signal, which is Simulink's port 2). Nothing about the conversion is emitted: there is no narrower type at either end.

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.