xPC Target | ![]() ![]() |
Signal Tracing with xPC Target GUI
Opening an Scope window on the host PC allows you to view signals with a graphical user interface (GUI).
After you create, download, and start running a target application, you can view signals. This procedure uses the Simulink model xpcosc.mdl
as an example, and assumes you are running the target application for that model.
The Manager window opens. This window is the root-window of the xPC Target Scope graphical interface.
At this point, the window is empty because you need to define a specific scope.
On the host PC, a new scope button appears on the Manager window and a new Scope window opens.
If the Scope window is in the background, on the Manager window, click the View Scope 1 button. The Scope window moves to the foreground.
The Scope window uses most of the area for signal plotting. At the bottom, there are controls to specify the scope functions.
The target PC displays the following message.
Scope: 1, created, type is host
The Add/Remove Signals dialog box opens. It allows you to specify which signals to trace.
The Signal list box displays all of the available signals from the target
application. The names of the signals correspond to the block names within
the Simulink model xpcosc.mdl
. The block name indicates the output
signal from that block.
Click a block name to highlight it, and then click the Add Signal button to move the signal to the Signals to trace box on the right of the window. The Signals to trace box contains the signals to be traced by this scope.
Changes to the Add/Remove Signals dialog box are shown below. The signals to trace can be removed by clicking the block name in the Signals to trace box, and then clicking the Remove Signal button.
During the next steps, you can leave the Add/Remove Signals dialog box open, or close and reopen it without restrictions.
You can now start the scope, but you must also start the target application
before the signals are visible in the scope window. If you use a scope, set the
final time to a value high enough to ensure the target application is running
during the entire signal tracing session. The final time is set by changing the
target object property tg.StopTime
.
+tg or tg.start or start(tg)
The target application and the scope starts running. You can start the scope and the target application in any order. The target application does not have to be running to start the scope or make changes to the scope properties. While the scope is running, the Start button on the Scope window changes to a Stop button.
If a target application is running and you start a scope, the host scope window acquires one data package, and then updates the signal graph. The time to collect one data package is equal to the number of samples multiplied by the sample time.
If you are using a scope with type host, there is a delay between collecting data packages because of the communication overhead from the target PC to the host PC. If you are using a scope with type target, the scope window is updated faster than when using a scope on the host PC.
![]() | Signal Tracing | Signal Tracing with xPC Target GUI (Target Manager) | ![]() |