MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
winopen(fullfile(qc_root, 'quarc', 'quarcdemos', 'quarc_labview_srv02_demo_client.vi')); quarc_labview_srv02_demo_serverQUARC LabVIEW Interfacing SRV02-ET Demo
This example consists of a QUARC model and a LabVIEW GUI. The QUARC model has a module that emulates the dynamics of a Quanser SRV02-ET servo, and a PIV controller module that generates input signals to the servo based on the command signal generated from the "Smooth Signal Generator" block and the feedback signal from the servo model.
The user is able to tune the signal generator and the controller by changing the values of amplitude, frequency, kp, and kv parameters through the LabVIEW GUI. Then the values will be transmitted via TCP/IP connection to the QUARC model.
The GUI and the model can be run on the same computer or two separate computers within a network.
Requirements
LabVIEW 2009 or later must be installed.
Configuration the Demonstration
To set up the model, double-click on the Stream Server block in the
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_labview_srv02_demo_server')To run the GUI on the same computer, enter the block diagram of the GUI and make sure it is connecting to localhost and the port number is consistent with the number in the QUARC model URI.
To run the GUI on another computer, enter the block diagram of the GUI and make sure it is connecting to the IP address of the computer where the QUARC model is running and the port number is consistent with the number in the QUARC model URI.
Demonstration
Select Ctrl+B while the diagram is the active window. A great deal of output will appear in the Diagnostic Viewer about the progress of the build. If you cannot see the Diagnostic Viewer, you can open it by selecting from the menu of the diagram, or clicking on the View Diagnostics hyperlink at the bottom of the diagram. If you have MATLAB R2013b or earlier then the output will appear in the MATLAB Command Window.
from the menu of the diagram, or pressClick on the
button or select from the menu of the diagram to connect to the model.Start the model by clicking on the
button or selecting from the menu of the diagram. The item of the menu may also be used to both connect and start the model in one operation.The sampling time can be changed by updating the value of Fixed-step size in .
Now in the LabVIEW GUI, click
button to start the process. The SRV-02 Angle plot in the LabVIEW GUI will show the commanded signal and the actual response of the SRV-02, as shown below:
Click on the
button or select from the menu of the diagram to stop the model. The item of the menu may also be used.Click the
button of the VI to halt the LabVIEW GUI.Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.