Table of Contents
HIL Write Analog Codes
Writes to the specified analog channels immediately. The inputs are the raw integer codes for the D/A converters.
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/Data Acquisition/Generic/Immediate I//O')Description
The HIL Write Analog Codes block writes to the specified analog channels every time the block is executed. The channels are written immediately. The inputs to the block of the raw integer codes for the D/A converters. The meaning of the integral codes depends on the hardware. This block is useful for prototyping fixed-point control algorithms and for teaching purposes.
Input Ports
The number of input ports depends on the Vector input parameter. If this option is checked then the input is a vector containing the raw analog codes to write to the channels specified in the Channels parameter. Otherwise there is one input port for each channel and each port contains the raw analog code to write to the corresponding channel. Refer to the documentation on the Vector input parameter below for more details.
Output Ports
This block has no output ports.
Data Type Support
The HIL Write Analog Codes block accepts signals of any of the built-in Simulink data types. Fixed point is not supported.
Parameters and Dialog Box
Board Name
The name of the board whose analog channels will be written. Boards are configured using the HIL Initialize block. Place an HIL Initialize block in your diagram to add a board name to the list.
Channels
The analog channels to write. The number of channels available depends on the board selected. Refer to Channels for more information.
Select a board type from the list for board-specific details:
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 from the input. The block inherits the sample time by default.
To set the sample time to the fundamental sampling time of the model, use the qc_get_step_size function, which is a QUARC function that returns the fundamental sampling time of the model. The fundamental sampling time of the model is the sampling time entered in the Fixed step size field of the Solver pane of the Configuration parameters.
Vector input
If this option is checked then the block will have a single vector input with one element in the vector for each channel. The raw integer codes for each channel should appear in the vector in the same order as the channels in the Channels parameter.
If this option is not checked then the block will have one input for each channel. The input ports will appear in the same order as the channels in the Channels parameter. Each port will be labeled with the corresponding channel number.
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 |
||
No |
No |
Not supported. |
|
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 |
Due to safety and liability concerns, the hardware may not be accessed during normal simulation. |
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.