Table of Contents
State Output
Writes states to be input by 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 Output block writes the value of its input to the specified state vector every time the block is executed. States are accessed by name. States are read by another model running on the same target using the State Input block. Thus, the State Output and State Input blocks effectively comprise a shared associative memory. The data type and number of elements in the state vector are determined by the datatype and dimensions of the input to the State Output block.
The State Output block is typically used within the Function Call Subsystem attached to a Switching Out block in order to transfer state information from the 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 Output blocks may be placed in the model, although it is more efficient to use fewer blocks.
It is not necessary to place a State Output 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 a single input port whose value is written to the specified state vector.
Output Ports
This block has no output ports.
Data Type Support
The State Output block outputs signals of any of the built-in Simulink datatypes, except fixed point.
Parameters and Dialog Box
State name
The name of the state to be written. States are read using the State Input block.
Final outputs
The value of this parameter is written to the state vector when the model is stopped if the Set final outputs at model termination option is checked. Otherwise this parameter is ignored.
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 sink block, it should generally inherit its sample time from its input.
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 Out block.
Active during normal simulation
Indicates whether this block should execute during normal simulation. If this option is checked then the block writes its state to the MATLAB workspace during normal simulation. This parameter has no effect on generated code but it does affect the performance of normal simulations.
Set final outputs have model termination
Indicates whether the value of the Final outputs parameter should be written to the state vector when the model is stopped. This option is generally only checked when the State Input and State Output blocks are being used as a simple shared memory communication mechanism and are not placed in a Function Call Subsystem attached to a Switching In or Switching Out 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.