MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
quarc_analog_loopback_demoQUARC Analog Loopback Demo
This example is a simple analog loopback test, but it demonstrates a number of important features of QUARC, such as the ability to access and quickly change hardware, multiple targets, online parameter tuning, data streaming, MAT-file logging, using Model Explorer and potentially more.
System Requirements
This demonstration requires hardware supported by the HIL blockset, such as the Q2-USB or Q8-USB hardware-in-the-loop card.
Configuring the Demonstration
To set up the demonstration for your data acquisition card, double-click on the HIL Initialize block and select the correct board type from the Board type combo box. If you have more than one board of the same type in your computer, change the Board number field to the board you wish to use. Boards are numbered from 0 such that board 0 is the first board recognized by the HIL blockset.
Do not run this demo if you are using the Quanser Q3 ControlPaQ-FW data acquisition card. This card does not support Analog outputs. You can run the QUARC Digital Loopback Demo for the Q3 ControlPaQ-FW device. For this data acquisition card's specifications and details, please refer to the Q3 ControlPaQ-FW reference page.
Now wire analog output channel #0 to analog input channel #0. For the Q2-USB or Q8-USB hardware-in-the-loop cards, simply connect an RCA cable from analog output #0 to analog input #0 on the terminal board.
Demonstration
Building, deploying and starting the model
Refer to One Step Process in QUARC Basic Procedures to build, deploy and start the model.
Running the model
Double-click on the Scope block to open the Scope.
A sine wave of amplitude 1 will appear in the Scope. Notice that the Scope trace is now moving in actual time. In other words, the trace passes the 10 second mark after 10 seconds has passed since QUARC runs the model in real-time on the QUARC target and communicate with Simulink via external mode communication.
Double-click on the Signal Generator block. Change the Amplitude parameter from 1 to 5. Click OK to close the Signal Generator dialog box. The amplitude of the sinewave trace changes to 5 to reflect the new amplitude.
Stopping the model
Refer to One Step Process in QUARC Basic Procedures to stop the model.
Running the example on a different target
To run the example on a different target, refer to the instructions on the Running QUARC Examples on Remote Targets page.
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.