Main Content

State Reader

Read a block state

  • Library:
  • Simulink / Signal Routing

  • State Reader block


The State Reader block reads the current state of a supported state owner block. When creating a library block with a State Reader block also include the state owner block.

Add a State Reader block to your model from the Simulink® Library Browser.

State Reader blocks can read state from these state owner blocks:

  • Discrete State-Space

  • Discrete-Time Integrator

  • Delay

  • Unit Delay

  • Discrete Transfer Fcn

  • Discrete Filter

  • Discrete FIR Filter

  • Integrator

  • Second-Order Integrator

  • Conditional subsystem blocks such as Enabled Subsystem, Triggered Subsystem, and Function-Call Subsystem.

  • S-Function with multiple discrete states.

    To configure an S-Function block as a state owner block, exactly one data type work vector must be declared as discrete state vector using ssSetDWorkUsedAsDState and named using ssSetDWorkName or ssSetDWorkRTWIdentifier in mdlInitializeSizes.



expand all

State value read from a state owner block.

The dimension of the output is the dimension of the full state vector. Refer to the Initial conditions parameter for specific blocks. For example, for a Delay block with a Delay length of N, the State Reader block returns a state vector of length [1xN].

Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fixed point


expand all

Show the state owner block whose state this block is reading. To change the state owner block, select a block from the State Owner Selector Tree.

Programmatic Use

Block Parameter: StateOwnerBlock
Type: character vector
Value: '' | '<model path/block name>'
Default: ''

Block Characteristics

Data Types

Boolean | bus | double | enumerated | fixed point | half | integer | single

Direct Feedthrough


Multidimensional Signals


Variable-Size Signals


Zero-Crossing Detection


Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.