Main Content

coder.descriptor.BreakpointDataInterface Class

Namespace: coder.descriptor
Superclasses: coder.descriptor.DataInterface

Return information about tunable breakpoint set data for a lookup table that has tunable parameters

Since R2020a

Description

The coder.descriptor.BreakpointDataInterface object describes various properties for breakpoint set data for these Lookup Table blocks that have tunable parameters in the generated code:

  • 1-D Lookup Table

  • 2-D Lookup Table

  • n-D Lookup Table

  • Interpolation Using Prelookup

  • Direct Lookup Table (n-D)

  • Sine

  • Cosine

Creation

params = getDataInterfaces(codeDescObj, dataInterfaceName) creates a coder.descriptor.BreakpointDataInterface object for each dimension in the lookup table. The codeDescObj object is the coder.codedescriptor.CodeDescriptor object created for the model by using the getCodeDescriptor function.

The coder.descriptor.LookupTableDataInterface and coder.descriptor.BreakpointDataInterface objects are created if these conditions are true:

  • Lookup table data is tunable.

  • One of these conditions is true:

    • Breakpoint set data is tunable.

    • Breakpoint set data is nontunable and the block does not use a Simulink.LookupTable object.

    • The block uses a Simulink.LookupTable object.

Input Arguments

expand all

Specify the Parameters data interface type.

Example: Parameters

Properties

expand all

The data type associated with the data such as integer, double, matrix, and its properties.

Attributes:

GetAccess
public
SetAccess
public

The Simulink identifier (SID) is a unique number within the model that Simulink assigns to a block.

Attributes:

GetAccess
public
SetAccess
public

The name of the associated tunable parameter for the breakpoints.

Attributes:

GetAccess
public
SetAccess
public

The variant conditions in the model that interact with the data interface.

Attributes:

GetAccess
public
SetAccess
public

Description of how the data in the generated code is implemented. This property describes characteristics such as data type and size. It also describes how the data is accessed or declared in the code. The property describes if the data is declared as a variable or structure member.

Attributes:

GetAccess
public
SetAccess
public

The rate at which data is accessed in a run-time environment.

Attributes:

GetAccess
public
SetAccess
public

Specified physical units as attributes on signals at the boundaries of model components.

Attributes:

GetAccess
public
SetAccess
public

The range of valid values for the block output signals.

Attributes:

GetAccess
public
SetAccess
public

To find the input value in the table, the operating point uses relative breakpoint set data.

Attributes:

GetAccess
public
SetAccess
public

Option to generate code that enables tunability of the effective size of the table, specified as 0 or 1.

Attributes:

GetAccess
public
SetAccess
public

Data Types: logical

Description of breakpoint set data that is either evenly spaced or non-evenly spaced. The coder.descriptor.FixAxisMetadata object is created only if the lookup table data is tunable and the breakpoint set data is not tunable.

Attributes:

GetAccess
public
SetAccess
public

Methods

expand all

Examples

collapse all

This example shows how to retrieve the breakpoint data set information.

Build a model

Open and build a model that contains lookup table blocks.

open_system('ASAP2Demo');
slbuild('ASAP2Demo');
### Searching for referenced models in model 'ASAP2Demo'.
### Found 1 model reference targets to update.
### Starting serial model reference code generation build.
### Successfully updated the model reference code generation target for: ASAP2DemoModelRef
### Starting build procedure for: ASAP2Demo
### Successful completion of build procedure for: ASAP2Demo

Build Summary

Model reference code generation targets:

Model              Build Reason                                 Status                        Build Duration
============================================================================================================
ASAP2DemoModelRef  Target (ASAP2DemoModelRef.c) did not exist.  Code generated and compiled.  0h 0m 9.4886s 

Top model targets:

Model      Build Reason                                         Status                        Build Duration
============================================================================================================
ASAP2Demo  Information cache folder or artifacts were missing.  Code generated and compiled.  0h 0m 15.924s 

2 of 2 models built (0 models already up to date)
Build duration: 0h 0m 27.32s

Return properties of Lookup Table parameter

Create a code descriptor object for the model.

codeDescObj = coder.getCodeDescriptor('ASAP2Demo');

Return properties of the Lookup Table parameter.

params = getDataInterfaces(codeDescObj,'Parameters');

The params variable is an array of coder.descriptor.DataInterface and coder.descriptor.LookupTableDataInterface objects. The model ASAP2Demo contains three Lookup Table blocks. Only two of them have tunable breakpoint set data. The code generator creates only two corresponding coder.descriptor.LookupTableDataInterface objects.

Obtain the details of the Standard_Axis block by accessing the sixth location in the array.

params(6)
ans = 
  LookupTableDataInterface with properties:
                       Type: [1x1 coder.descriptor.types.Type]
                        SID: 'ASAP2Demo:12'
              GraphicalName: 'tabledata'
                VariantInfo: [1x0 coder.descriptor.VariantInfo]
             Implementation: [1x1 coder.descriptor.DataImplementation]
                     Timing: [1x0 coder.descriptor.TimingInterface]
                       Unit: 'rpm'
                      Range: [1x1 coder.descriptor.Range]
         SupportTunableSize: 0
    BreakpointSpecification: 'Explicit values'
                     Output: [1x1 coder.descriptor.DataInterface]
                Breakpoints: [1x2 coder.descriptor.BreakpointDataInterface Sequence]

The Breakpoints property of the coder.descriptor.LookupTableDataInterface object holds a vector of coder.descriptor.BreakpointDataInterface objects. Obtain the details of the breakpoint set attached to the model Lookup Table block by accessing the first location in the array.

params(6).Breakpoints(1)
ans = 
  BreakpointDataInterface with properties:
                  Type: [1x1 coder.descriptor.types.Type]
                   SID: 'ASAP2Demo:12'
         GraphicalName: 'tabledata'
           VariantInfo: [1x0 coder.descriptor.VariantInfo]
        Implementation: [1x1 coder.descriptor.DataImplementation]
                Timing: [1x0 coder.descriptor.TimingInterface]
                  Unit: ''
                 Range: [1x0 coder.descriptor.Range]
        OperatingPoint: [1x1 coder.descriptor.DataInterface]
    SupportTunableSize: 0
       FixAxisMetadata: [1x0 coder.descriptor.FixAxisMetadata]

Version History

Introduced in R2020a