Main Content

State Writer

Write to a block state

  • Library:
  • Simulink / Signal Routing

  • State Writer block

Description

TheState Writerblock sets the state of a supported state owner block. When creating a library block with aState Writerblock also include the state owner block.

Add aState Writerblock to your model from the Simulink®Library Browser.

State Writerblocks can write state to 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 asEnabled Subsystem,Triggered Subsystem, andFunction-Call Subsystem.

  • S-Functionwith 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.

Ports

Input

expand all

State value written to a state owner block.

When writing to a state owner block with an input scalar, the scalar value is expanded to match the dimension of the state. All elements of the state are set to the same value.

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

Parameters

expand all

显示主人块的状态这一块is writing. To change the state owner block, select a block from theState Owner Selector Tree.

Programmatic Use

Block Parameter:StateOwnerBlock
Type:character vector
Value:''|''
Default:''

Block Characteristics

Data Types

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

Direct Feedthrough

no

Multidimensional Signals

yes

Variable-Size Signals

no

Zero-Crossing Detection

no

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