Using the Host Scope

From Mech
Jump to: navigation, search

MATLAB implemented a "Host Scope" in version 2006a. This is allows you to view scopes of real-time data from the target PC on the Host PC screen. It is a little tricky to use, so here are some instructions:

1. Add a xPC scope to your model (from the xPC Target\Misc menu). We will use the simple model below for instructional purposes.

Hostscope1.jpg

2. Double-click on the Scope to open the properties dialog. Change the Scope type to "Host" and the Number of samples to something like 1000.

Hostscope2.jpg

3. Now build your model by pressing Ctrl-B.

4. Open xpcexplr

5. Right-click on "TargetPC1" on the left menu and click "Connect". The menu will expand.

Hostscope3.jpg

6. Expand the list to find xPC Scopes \ Host Scope(s) \ Scope: 1

7. Right click on "Scope: 1" and click "View Scope". This will open up the scope window.

8. Now you can start your model any way you like. After the model has started, you will see the scope data displayed.

To get better performance that suits your application, try adjusting the "Number of Samples" and "Decimation" values for the scope.

Personal tools