Main Content

Input and Output Component Interface Signals

Metric ID

slcomp.ComponentInterfaceSignals

Description

Use this metric to count the number of root-level, input signals and output signals that connect to the component interface.

This metric counts signals to or from:

  • Simulink® Inport blocks

  • Simulink Outport blocks

  • Input ports for Stateflow® charts

  • Output ports for Stateflow charts

  • Inputs and outputs to MATLAB® code

Computation Details

The metric:

  • Returns the number of component interface signals. If the data type of an input or output is Bus, the metric counts the individual elements in the bus.

  • Displays a warning if the data type of an input or output is set to 'Inherit: auto'. The metric is unable to resolve inherited data types. Specify valid data types, other than 'Inherit: auto', for root outports and inports.

  • Displays a warning if the 'HasAccessToBaseWorkspace' property for a model is set to true. Data type definitions accessed from the base workspace are not considered by traceability analysis. Changes to base workspace variables will not cause the metric to be recollected.

Collection

To collect data for this metric:

  • In the Model Maintainability Dashboard, in the Component Interface section, point to the Input Signals or Output Signals widgets and click the Run metrics for widget icon.

  • Use getMetrics with the metric identifier slcomp.ComponentInterfaceSignals.

Results

For this metric, instances of metric.Result return the Value as a vector that contains these elements:

  • Value(1) — The number of input component interface signals. This corresponds to the Input Signals widget in the Component Interface section.

  • Value(2) — The number of output component interface signals. This corresponds to the Output Signals widget in the Component Interface section.

The results of this metric correspond to the Input Signals and Output Signals widgets in the Component Interface section.

Examples

Suppose your unit is a model that has six Inport blocks and two Outport blocks that connect to your component, this metric returns a Result array with a Value property of [6, 2].

See Also

Related Topics