Table of Contents
Target Switch Model
Switches models on a QUARC target.
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 Target Switch Model block switches models on the QUARC target identified by the connection name. The connection name matches the name of a Target Connect block in the diagram. A Target Connect block must be present.
This block switches out the model identified by the reconfiguration group specified and switches in the model identified by name. The incoming model must already be downloaded to the target.
The "-w" (wait) option should not be specified as a model argument or the switch will not occur until an external mode connection is made to the incoming model from the corresponding Simulink diagram. |
In particular, suppose the supervisory model containing the Target Switch Model block is running on Target A. Furthermore, suppose the supervisory model contains a Target Connect block configured to connect to Target B. Thus, if the Target Switch Model block's Name of model to switch in parameter is set to Model A then when the supervisory model is run on Target A, the Target Switch Model block will switch to Model A on Target B, switching out any model in the given reconfiguration group that is currently running on Target B.
Any Switching In blocks in the incoming model will execute the Function Call Subsystem connected to their output. Likewise, any Switching Out blocks in the outgoing model will execute the Function Call Subsystem connected to their output.
This block is part of the dynamic reconfiguration facilities of QUARC which allow running models to be swapped for another model on-the-fly. In particular, dynamic reconfiguration may be performed under the control of a supervisory model.
Models which will be dynamically reconfigured should have the Support dynamic reconfiguration option 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 no output ports.
Parameters and Dialog Box
Connection name
The name of the connection identifying the QUARC target on which the specified model will be switched in. The connection names correspond to the names of Target Connect blocks in the diagram. Using connection names as an alias for the actual target URI allows the target URI to be changed in one place rather than in every block using the connection.
Reconfiguration group of model to switch out
A positive integer identifying the reconfiguration group of the model to switch out. Models that do not contain a Reconfiguration Group block are assigned to group 0.
Name of model to switch in
The name of the model to switch in. The code for this model must have already been built and downloaded to the target associated with the connection.
Arguments for model to switch
The command-line arguments to pass to the model loaded. Standard command-line arguments are:
inf
to run indefinitely.
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. The sample time must be inherited when the block 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 conditionally-executed or asynchronous subsystem.
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 |
Unlike normal simulation, the Target Switch Model block will switch code on the QUARC Target indicated by the Target URI. |
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
The Target Switch Model block will stop the Simulink diagram of a model running in normal simulation in the given reconfiguration group. It will then run the model to be switched in as a normal simulation. Switching In and Switching Out blocks will execute their Function Call Subsystems as appropriate. |
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.