| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → xPC Target |
| Contents | Index |
| Learn more about xPC Target |
xPC Target Library for Misc.
For information about this block, see Adding an xPC Target Scope Block and Entering Parameters for an xPC Target Scope Block of the xPC Target Getting Started Guide.
There are three types of scopes, target, host, and file. The xPC Target Scope block dialog changes depending on which scope type (Scope type) you select. By default, the scope dialog displays the scope of type Target dialog. The following sections describe the parameters depending on the scope type:
Note If you want to monitor an output signal from a Constant block by connecting it to an xPC Target Scope block, you must add a test point for the Constant block output signal. |
Note If your model has the output of a Mux block connected to the input of an xPC Target Scope block, the signal might not be observable. To ensure that you can observe the signal, add a unity gain block (a Gain block with a gain of 1) between the Mux block and the xPC Target Scope block. |
Contains a unique number to identify the scope that is displayed. This number is incremented each time you add a new xPC Target Scope block. Normally, you do not want to edit this value.
This number identifies the xPC Target Scope block and the scope screen on the host or target computer.
From the list, select Target if it is not already selected.
The updated dialog box displays.
Select this check box to start a scope when the target application is downloaded and started. The scope window opens automatically.
From the list, select one of the following:
Numerical — Displays the data numerically.
Graphical redraw — Displays a cycle of data continuously without any scrolling (refreshing the entire plot).
Graphical sliding — Like graphical rolling mode. This mode displays the older data on the right side of the scope and the newer data on the left side of the scope. A vertical line separates the two types of data.
Graphical rolling — Displays running data continuously scrolling from left to right across the scope (similar behavior to oscilloscopes).
If you have a scope type of Target and a scope mode of Numerical, the scope block dialog adds a Numerical format box to the dialog. You can define the display format for the data. If you choose not to complete the Numerical format box, the xPC Target software displays the signal using the default format of %15.6f. This format is a floating point one, with no label.
If you have a scope type of Target and a scope mode of Numerical, the scope block dialog adds a Numerical format box to the dialog. Enter a label and associated numeric format type in which to display signals. By default, the entry format is the floating point %15.6f. The Numerical format box takes entries of the format:
'[LabelN] [%width.precisiontype] [LabelX]'
where
LabelN is the label for the signal. You can use a different label for each signal or the same label for each signal. This argument is optional.
width is the minimum number of characters to offset from the left of the screen or label. This argument is optional.
precision is the maximum number of decimal points for the signal value. This argument is optional.
type is the data type for the signal format. You can use one or more of the following types:
Type | Description |
|---|---|
%e or %E | Exponential format using e or E |
%f | Floating point |
%g | Signed value printed in f or e format depending on which is smaller |
%G | Signed value printed in f or E format depending on which is smaller |
LabelX is a second label for the signal. You can use a different label for each signal or the same label for each signal. This argument is optional.
Enclose the contents of the Numerical format field in quotation marks.
For example
'Foo %15.2f end'
For a whole integer signal value, enter 0 for the precision value. For example
'Foo1 %15.0f end'
For a multiple format entries, delimit each entry with a comma and surround the entire string with a pair of quotes. For example
'Foo2 %15.6f end,Foo3 %15.6f end2'
You can have multiple Numerical format entries, separated by a comma. If you enter one entry, that entry applies to each signal (scalar expansion). If you enter fewer label entries than signals, the first entry applies to the first signal, the second entry applies to the second signal, and so forth, and the last entry is scalar expanded for the remaining signals. If you have two entries and one signal, the xPC Target software ignores the second label entry and applies the first entry. You can enter as many format entries as you have signals for the scope.
Select this check box to display grid lines on the scope. Note that this parameter is only applicable for scopes of type Target and scope modes of type Graphical redraw, Graphical sliding, and Graphical rolling.
Enter a row vector with two elements where the first element is the lower limit of the y-axis and the second element is the upper limit. If you enter 0 for both elements, then the scaling is set to auto. Note that this parameter is only applicable for scopes of type Target and scope modes of type Graphical redraw, Graphical sliding, and Graphical rolling.
Enter the number of values to be acquired in a data package.
If you select a Scope mode of Graphical redraw, this parameter specifies the number of values to be acquired before the graph is redrawn.
If you select a Trigger mode other than FreeRun, this parameter can specify the number of samples to be acquired before the next trigger event.
If you select a Scope mode of Numerical, the block updates the output every Number of samples.
Enter the number of samples to save or skip. Specify a value less than 0 to save this number of samples before a trigger event. Specify a value greater than 0 to skip this number of samples after the trigger event before data acquisition begins.
Enter a value to collect data at each sample time (1) or to collect data at less than every sample time (2 or greater).
From the list, select either FreeRun, Software Triggering, Signal Triggering, or Scope Triggering.
If you select FreeRun or Software Triggering, you do not need to specify anything else.
If you select Signal Triggering, then in the Trigger signal box, enter the index of a signal. In the Trigger level box, enter a value for the signal to cross before triggering. From the Trigger slope list, select either, rising, or falling. You do not need to specify the Trigger scope number.
If you select Scope Triggering, then in the Trigger scope number box, enter the scope number of a Scope block. If you use this trigger mode, you must also add a second Scope block to your Simulink model. You do not need to specify the Trigger signal.
If you want the scope to trigger on a specific sample of the other scope, enter a value in the Sample to trigger on box. The default value is 0 and indicates that the triggering scope and the triggered (current) scope start simultaneously. For more information on this field, see Triggering One Scope with Another Scope to Acquire Data in xPC Target User's Guide.
For additional information on trigger, see Advanced Data Acquisition Topics.
Contains a unique number to identify the scope that is displayed. This number is incremented each time you add a new xPC Target scope block. Normally, you do not want to edit this value.
This number identifies the xPC Target Scope block and the scope screen on the host or target computer.
From the list, select Host.
The updated dialog box is displayed.
Select this check box to start a scope when the target application is downloaded and started. With a scope of type target, the scope window opens automatically. With a scope of type host, you can open a host scope viewer window from xPC Target Explorer.
Enter the number of values to be acquired in a data package.
Enter the number of samples to save or skip. Specify a value less than 0 to save this number of samples before a trigger event. Specify a value greater than 0 to skip this number of samples after the trigger event before data acquisition begins.
Enter a value to collect data at each sample time (1) or to collect data at less than every sample time (2 or greater).
From the list, select either FreeRun, Software Triggering, Signal Triggering, or Scope Triggering.
If you select FreeRun or Software Triggering, the trigger event is an automatic one. No other trigger specification is required (see trigger for further details on software trigger).
If you select Signal Triggering, then in the Trigger signal box, enter the index of a signal. In the Trigger level box, enter a value for the signal to cross before triggering. From the Trigger slope list, select either, rising, or falling. You do not need to specify scope triggering.
If you select Scope Triggering, then in the Trigger scope number box, enter the scope number of a Scope block. If you use this trigger mode, you must also add a second Scope block to your Simulink model. You do not need to specify signal triggering.
If you want the scope to trigger on a specific sample of the other scope, enter a value in the Sample to trigger on box. The default value is 0 and indicates that the triggering scope and the triggered (current) scope start simultaneously. For more information on this field, see Triggering One Scope with Another Scope to Acquire Data in the xPC Target User's Guide.
Contains a unique number to identify the scope that is displayed. This number increments each time you add a new xPC Target scope block. Normally, you do not want to edit this value.
This number identifies the xPC Target Scope block and the scope screen on the host or target computer.
From the list, select File.
The updated dialog box is displayed.
Select the check box to start a scope when the target application is downloaded and started. The scope window opens automatically.
Enter the number of values to be acquired in a data package. This parameter works in conjunction with the AutoRestart check box. If the AutoRestart box is selected, the scope of type file collects data up to Number of samples, then starts over again, overwriting the buffer. If the AutoRestart box is not selected, the scope of type file collects data only up to Number of samples, then stops.
Enter the number of samples to save or skip. Specify a value less than 0 to save this number of samples before a trigger event. Specify a value greater than 0 to skip this number of samples after the trigger event before data acquisition begins.
Enter a value to collect data at each sample time (1) or to collect data at less than every sample time (2 or greater).
From the list, select either FreeRun, Software Triggering, Signal Triggering, or Scope Triggering.
If you select FreeRun or Software Triggering, the trigger event is an automatic one. No external trigger specification is required.
If you select Signal Triggering, then in the Trigger signal box, enter the index of a signal. In the Trigger level box, enter a value for the signal to cross before triggering. From the Trigger slope list, select either, rising, or falling. You do not need to specify scope triggering.
If you select Scope Triggering, then in the Trigger scope number box, enter the scope number of a Scope block. If you use this trigger mode, you must also add a second Scope block to your Simulink model. You do not need to specify signal triggering.
If you want the scope to trigger on a specific sample of the other scope, enter a value in the Sample to trigger on box. The default value is 0 and indicates that the triggering scope and the triggered (current) scope start simultaneously. For more information on this field, see Triggering One Scope with Another Scope to Acquire Data in the xPC Target User's Guide.
Enter a name for the file to contain the signal data. By default, the target PC writes the signal data to a file named C:\data.dat.
From the list, select either Lazy or Commit. Both modes open a file, write signal data to the file, then close that file at the end of the session. With the Commit mode, each file write operation simultaneously updates the FAT entry for the file. This mode is slower, but the file system always knows the actual file size. With the Lazy mode, the FAT entry is updated only when the file is closed and not during each file write operation. This mode is faster, but if the system crashes before the file is closed, the file system might not know the actual file size (the file contents, however, will be intact).
Enter the block size, in bytes, of the data chunks. This parameter specifies that a memory buffer, of length Number of samples, writes data to the file in WriteSize chunks. By default, this parameter is 512 bytes, which is the typical disk sector size. Using a block size that is the same as the disk sector size provides optimal performance.
Enter the number of values to be acquired in a data package.
Select this check box to enable the scope of type file to collect data up to Number of samples, then start over again, appending the new data to the end of the signal data file. Clear the AutoRestart check box to have the scope of type file collect data up to Number of samples, then stop.
![]() | Time Stamp Delta | Software Reboot | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |