Products & Services Solutions Academia Support User Community Company

Learn more about SystemTest   

Basic Elements

Introduction

The sections listed above describe how to work with the basic elements.

The Simulink element is covered in detail in Using the Simulink Element. The hardware elements are covered in detail in Introduction in Using the Image Acquisition Toolbox Element, Introduction in Using the Data Acquisition Toolbox Elements, and Introduction in Using the Instrument Control Toolbox Elements.

To see the MATLAB, Limit Check, and General Plot elements used in an example, see Adding Elements.

Invalid Characters in Element Names

The following characters are invalid to include within element names:

You cannot use these three characters in element names. If you create a new test element with one or more of these characters in the element name, then the SystemTest software throws an error dialog and the element name is reset to the default value, which is the name of the element type.

If you try to load an existing test with an invalid element name (containing one or more of the three characters listed above), the SystemTest software displays an error dialog indicating that the element name is invalid. The test will load successfully, but the element with an invalid name is reset to use the default name for the element. If this occurs, simply rename the element to a name that does not contain any of the invalid characters.

MATLAB Element

The MATLAB element lets you run MATLAB scripts from within a test. In addition to specifying any valid MATLAB script to execute, you can incorporate any test variable into your code, as well as access any variables residing in the MATLAB workspace.

Allowed Test Sections

The MATLAB element can be used in the following test sections:

Properties Pane

In the MATLAB Script edit field, enter any valid MATLAB script.

Limit Check Element — General Check

The General Check tab of the Limit Check element determines test conditions are met by using scalar, vector, or matrix comparisons. It can be used to:

You can do the following types of comparisons with the General Check tab of the Limit Check element:

Allowed Test Sections

The Limit Check element can be used in the following test section:

How to Use

  1. Click the New button on the General Check tab to add a general limit check.

    • Select an existing test variable or create a new one in the Test Variable column.

    • Select an operator in the Operator column.

    • Select an existing test variable or test vector or create a new one in the Limit column.

  2. Set your test's passing conditions.

    • The element can pass if all comparisons complete successfully (a logical AND).

    • The element can pass if one or more of the comparisons complete successfully (a logical OR).

  3. Set your fallback procedure if the element fails. You can:

    • Allow the current iteration to continue executing.

    • Stop the current iteration and proceed to the next iteration.

    • Stop the test and proceed to Post Test.

  4. Identify the SystemTest test variable you want to assign the logical value derived from the comparison(s) in the Assign data to field.

Properties Pane — General Check

You can set the following properties for the Limit Check element:

Limit Check Element — Tolerance Check

The Tolerance Check tab of the Limit Check element verifies test conditions are met by using absolute and relative tolerance comparisons. It can be used to:

You can do the following types of comparisons with the Tolerance Check tab of the Limit Check element:

For a definition of these tolerance types, see the Properties Pane section.

Allowed Test Sections

The Limit Check element can be used in the following test section:

How to Use

  1. Click the New button on the Tolerance Check tab to add a tolerance limit check.

    • Select an existing test variable or create a new one in the Test Variable column.

    • Select an existing test variable or test vector or create a new one in the Expected Value column.

    • Select Absolute or Relative in the Tolerance Type column.

    • Select an existing test variable or test vector or create a new one in the Tolerance Limit column.

  2. Set your test's passing conditions.

    • The element can pass if all comparisons complete successfully (a logical AND).

    • The element can pass if one or more of the comparisons complete successfully (a logical OR).

  3. Set your fallback procedure if the element fails. You can:

    • Allow the current iteration to continue executing.

    • Stop the current iteration and proceed to the next iteration.

    • Stop the test and proceed to Post Test.

  4. Identify the SystemTest test variable you want to assign the logical value derived from the comparison(s) in the Assign data to field.

Properties Pane — Tolerance Check

You can set the following properties for the Limit Check element.

IF Element

The IF element provides logical control of a test by evaluating a condition.

The IF element allows sub-elements to run only when the IF element's condition evaluates to true. After adding an IF element, you should add one or more elements to perform a specific task.

Allowed Test Sections

The IF element can be used in the following test sections:

Properties Pane

You can set the following property for the IF element.

General Plot Element

The General Plot element is used to plot any type of data over multiple iterations.

Use this element during the Main Test to generate plots of any test vectors or test variables containing any type of data.

Allowed Test Sections

The General Plot element can be used in the following test section:

General Tab

To add a plot:

  1. Click the Add Plot button to create a plot.

  2. From the drop-down list, select one of the following:

    • plot — A standard line plot that uses a 2-D line graph with linear axes.

    • Simulink data — Lets you plot data produced from a Simulink model. The supported data types are such [time signal] array, a structure, a structure with time, or a time series. Note that the element creates a line for each signal in the Simulink data. If time is not present, the signals are plotted against their indices.

      You can also plot Simulink data provided by test vectors, such as the Signal Builder Block test vector, the Simulink Design Verifier Data File test vector, or the Spreadsheet Data test vector.

    • bar — A standard bar plot that creates a bar graph.

    • scatter — A standard scatter plot that creates a 2-D scatter graph displaying markers at x- and y-coordinates.

    • contour — A standard line plot that creates a 3-D contour graph displaying isolines of a surface in a 3-D view.

    • imagesc — An image plot with colormap scaling, which displays an image and scales it to use the full colormap.

    • surf — A standard surface plot that creates a 3-D surface plot that displays a matrix as a surface.

    • mesh — A standard surface plot that creates a 3-D mesh plot displaying a matrix as a wireframe surface.

    • More plots — Opens the Choose Plot Type dialog box, which lets you choose any MATLAB plot. Select a plot type category in the Categories list to display the plot types from the Plot Types list. Select an individual plot type to read the Description.

Add Axes Button

You can have multiple axes in a plot figure. To add an axes, click the Add Axes button. Then click the Add Plot button to create the plot for that axes. Each axes is added as a subplot to the parent figure.

You can set properties for each axes individually by selecting the axes and then configuring properties in the Properties area. With the axes selected, you can configure the X and Y labels and add a title and legend. With the plot under the axes selected, you can configure the plot.

Properties

When the Figure node is selected or you have not yet added a plot, the Figure name field is displayed. Optionally use this text field to name the plot.

When you select a plot type and it is added to the tree, the Properties section displays the properties of that plot type. Fill in any parameters you want to set. For more information on the parameters, see the help in the Choose Plot Type dialog box when you select More Plots.

When you select an axes the axes properties are displayed. Use the X label and Y label fields to enter names for the X and Y axes. Use the Title field to enter a title for the plot. If you select the Include legend option, a legend is added to the plot. The legend is located in the least used space outside of the plot.

You can set other options for the General Plot element by clicking the Options tab.

Plotting Simulink Data

You can plot data produced from a Simulink model. The supported data types are such [time signal] array, a structure, a structure with time, or a time series. Note that the element creates a line for each signal in the Simulink data. If time is not present, the signals are plotted against their indices.

You can also plot Simulink data provided by test vectors, such as the Signal Builder Block test vector, the Simulink Design Verifier Data File test vector, or the Spreadsheet Data test vector.

The Simulink data types are plotted as follows:

Options Tab

These options control the test behavior pertaining to plots.

The Each time the element executes option determines run-time behavior of the element.

The If this test is generating a report option determines what happens to the snapshots of the plots that are created when each iteration runs.

Vector Plot Element

Note: The Vector Plot and Scalar Plot elements are being replaced by the General Plot element that was introduced in R2008b. The General Plot element supports all MATLAB plot types as well as Simulink data. Customers should no longer create new Vector Plot or Scalar Plot elements. For more information, see the R2009b section of the SystemTest Release Notes.

The Vector Plot element is used to plot array or vector data over multiple iterations.

Use this element during the Main Test to generate plots of any test variables containing array or vector data. You can change the number of iterations displayed to as many as 16 (in a 4-by-4 matrix) using the Subplot Dimensions fields. The default is one iteration.

Allowed Test Sections

The Vector Plot element can be used in the following test section:

Plot Type

Choose one of the following plot types:

Properties Pane

You can set the following properties for the Vector Plot element.

Subplot Dimensions

Scalar Plot Element

Note: The Scalar Plot and Vector Plot elements are being replaced by the General Plot element that was introduced in R2008b. The General Plot element supports all MATLAB plot types as well as Simulink data. Customers should no longer create new Scalar Plot or Vector Plot elements. For more information, see the R2009b section of the SystemTest Release Notes.

The Scalar Plot element is used to plot scalar data for each iteration.

Use this element during the Main Test to generate a plot of one or more scalar test variables.

Allowed Test Sections

The Scalar Plot element can be used in the following test section:

Plot Type

Choose one of the following plot types:

Properties Pane

You can set the following properties for the Scalar Plot element.

Stop Element

The Stop element stops an iteration or an entire test unconditionally.

You can use the Stop element with conditional logic elements, such as the IF element, to control the test's execution.

Allowed Test Sections

The Stop element can be used in the following test sections:

Properties Pane

You can set the following properties for the Stop element.

Subsection Element

Use subsection elements to organize one or more elements to maintain readability of your test or to better manage complex test structures. Use a subsection to:

Allowed Test Sections

The Subsection element can be used in the following test sections:

Properties Pane

You can set the following properties for the Subsection element.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS