Documentation

sltest.testsequence.getProperty

Get Test Sequence block properties

Syntax

blockInfo = sltest.testsequence.getProperty(blockPath)
blockInfo = sltest.testsequence.getProperty(blockPath,propertyName)

Description

blockInfo = sltest.testsequence.getProperty(blockPath) returns a struct blockInfo containing properties of the Test Sequence block specified by blockPath.

blockInfo = sltest.testsequence.getProperty(blockPath,propertyName) returns blockInfo, containing the value of propertyName.

Examples

collapse all

This example gets and sets properties for a Test Sequence block using the programmatic interface.

1. Load the model.

cd(matlabroot)
Model = 'sltestRollRefTestExample';
load_system(fullfile(matlabroot,'examples','simulinktest',Model))

2. Get properties of the Test Sequence block.

blockInfo = sltest.testsequence.getProperty([Model '/Test Sequence'])
blockInfo = 

  struct with fields:

                         Name: 'Test Sequence'
                 UpdateMethod: 'INHERITED'
                   SampleTime: ''
                  Description: ''
                     Document: ''
                          Tag: []
        supportVariableSizing: 1
    SaturateOnIntegerOverflow: 1
                  InputFimath: 'fimath(......'
             EmlDefaultFimath: 'Same as MATLAB Default'
       EnableActiveStepOutput: 0
                   OutputData: ''

3. Get the Test Sequence block update method.

blockUpdateMethod = sltest.testsequence.getProperty(...
    [Model '/Test Sequence'],'UpdateMethod')
blockUpdateMethod =

    'INHERITED'

4. Change the Test Sequence block update method and sample time.

sltest.testsequence.setProperty([Model '/Test Sequence'],...
    'UpdateMethod','Discrete','SampleTime','0.1')

5. Check the changes.

blockInfo = sltest.testsequence.getProperty([Model '/Test Sequence'])
blockInfo = 

  struct with fields:

                         Name: 'Test Sequence'
                 UpdateMethod: 'DISCRETE'
                   SampleTime: '0.1'
                  Description: ''
                     Document: ''
                          Tag: []
        supportVariableSizing: 1
    SaturateOnIntegerOverflow: 1
                  InputFimath: 'fimath(......'
             EmlDefaultFimath: 'Same as MATLAB Default'
       EnableActiveStepOutput: 0
                   OutputData: ''

5. Close the model.

close_system(Model,0)

Input Arguments

collapse all

Path to a Test Sequence block, including the block name, specified as a character vector.

Example: 'FanSpeedTestHarness/Test Sequence'

Name of a particular Test Sequence block property to get a value for.

Example: 'Description'

Output Arguments

collapse all

Output of block properties, or the value of a particular block property

Example: struct with fields

Example: char array

Example: logical

Introduced in R2017a

Was this topic helpful?