xPC Target | ![]() ![]() |
Signal Tracing with xPC Target Scope Blocks
Use scopes of type host to log signal data triggered by an event while your target application is running.
Scope of Type Host
For a scope of type host, the scope acquires the first N
samples into a buffer. You can retrieve this buffer into the scope object property (sc.Data
). The scope then stops and waits for you to manually restart the scope.
The number of samples N
to log after triggering an event is equal to the value you entered in Number of Samples.
Select the type of event in the Block Parameters: Scope (xPC Target) dialog box by setting Trigger Mode to Signal Triggering
, Software Triggering
, or Scope Triggering
.
Scope of Type Target
For a scope of type target, logged data (sc.Data
, sc.Time
, and sc.StartTime
) is not accessible over the command-line interface on the host PC. This is because the scope object status (sc.Status
) is never set to Finished
. Once the scope completes one data cycle (time to collect the Number of Samples), the scope engine automatically restarts the scope.If you create a scope object (for example, sc = getscopes(tg,1) for a scope of type target, and then try to get the logged data by typing sc.Data
, you will get an error message.
If you want the same data for the same signals on the host PC while the data is displayed on the target PC, you need to define a second scope object with type host. Then you need to synchronize the acquisition of the two scope objects by setting TriggerMode for the second scope to 'Scope'
.
![]() | Signal Tracing with MATLAB | Signal Tracing with a Web Browser | ![]() |