Table of Contents
State Input
Reads states output from another model.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library/Advanced/Dynamic Reconfiguration')Description
The State Input block reads the specified states every time the block is executed. States are accessed by name. States are written from another model running on the same target using the State Output block. Thus, the State Input and State Output blocks effectively comprise a shared associative memory. The data type and number of elements must match the data written by the corresponding State Output block exactly.
The State Input block is typically used within the Function Call Subsystem attached to a Switching In block in order to transfer state information from a model being switched out to the model being dynamically switched in. However, it may be used anywhere in the diagram. Also, any number of State Input blocks may be placed in the model, although it is more efficient to use fewer blocks.
It is not necessary to place a State Input block in the diagram to support dynamic reconfiguration. If no dynamic reconfiguration blocks are present in the diagram, then the Support dynamic reconfiguration option must be checked on the Code Generation/QUARC tab of the Configuration Parameters dialog.
Input Ports
This block has no input ports.
Output Ports
This block has a single output port whose data type and dimensions are determined by the Output data type and Number of elements parameters respectively. The output is the value of the state.
Data Type Support
The State Input block outputs signals of any of the built-in Simulink datatypes, except fixed point. The data type is set using the Output data type parameter.
Parameters and Dialog Box
State name
The name of the state to be read. States are written using the State Output block.
Output data type
The data type of the state to be read. The data type must match the type of data written by the State Output block.
Number of elements
The number of elements in the state to be read. The number of elements must match the length of the state vector written by the State Output block.
Sample time
The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.
A sample time of -1 indicates that the block inherits its sample time. Since this is a source block, only inherent the sample time when it is placed in a conditionally executed subsystem, like a Triggered Subsystem, Enabled Subsystem, Function Call Subsystem or in a referenced model.
To use the fundamental sampling time of the model, set the sample time to qc_get_step_size, which is a QUARC function that returns the fundamental sampling time of the model.
The default sample time is set to -1
because this block is typically used in a Function Call Subsystem attached to a
Switching In block.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
Yes |
Yes |
|
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.