This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Simulink.HMI.SignalSpecification class

Package: Simulink.HMI

Information for logging a signal


The Simulink.HMI.SignalSpecification object contains the block path and port index required by Simulink.sdi.markSignalForStreaming to turn logging on or off for a signal.


sigSpec = instSigs.get(index) returns the Simulink.HMI.SignalSpecification object sigSpec for the signal at the specified index in the Simulink.HMI.InstrumentedSignals object instSigs.

Input Arguments

expand all

Numeric index of the signal within the Simulink.HMI.InstrumentedSignals object.

Example: 1


expand all

Simulink.BlockPath object with the block path for the signal.

Index of the signal on the output port of its block. For Stateflow signals, the OutputPortIndex is set to 1.

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects (MATLAB).


collapse all

This example shows how to obtain the block paths for logged signals and remove the logging badge for a signal using Simulink.HMI.InstrumentedSignals and Simulink.HMI.SignalSpecification objects.

Get InstrumentedSignals Object

% Load the model sldemo_absbrake

% Get logged signals with Simulink.HMI.InstrumentedSignals object
instSigs = get_param('sldemo_absbrake', 'InstrumentedSignals');

% Check logged signals count
ans = uint32

Inspect Block Paths with SignalSpecifications Objects

Use the get method to get the Simulink.HMI.SignalSpecification objects for each of the signals in the Simulink.HMI.InstrumentedSignals object

% Get Simulink.HMI.SignalSpecification objects
sig1 = instSigs.get(1);
sig2 = instSigs.get(2);

% Inspect block paths for signals
blockPath1 = sig1.BlockPath
blockPath1 = 
  Package: Simulink

  Block Path:
    sldemo_absbrake/Bus Creator

  Use the getBlock method to access block path strings from this object.

blockPath2 = sig2.BlockPath
blockPath2 = 
  Package: Simulink

  Block Path:
    sldemo_absbrake/Relative Slip

  Use the getBlock method to access block path strings from this object.


Remove Logging Badge for Bus Signal

Remove the logging badge for the signal from the Bus Creator block.

% Get block path string and port index for the Bus Creator signal
blockPath_str = blockPath1.getBlock(1);
portIndex = sig1.OutputPortIndex;

% Clear the logging badge for the Bus Creator signal
Simulink.sdi.markSignalForStreaming(blockPath_str, portIndex, 'off')

Introduced in R2015b