Package: Simulink
Superclasses:
Store and share data for a breakpoint set, configure the data for ASAP2 and AUTOSAR code generation
An object of the Simulink.Breakpoint
class
stores breakpoint set data for a lookup table. You can use that data
in one or more Prelookup blocks.
With the object, you can specify a data type and code generation settings
for the breakpoint set and share the set between multiple lookup tables.
Use Simulink.Breakpoint
objects and Simulink.LookupTable
objects
to configure COM_AXIS code generation for calibration.
The code generated for a Simulink.Breakpoint
object
is an array or a structure with two fields. If you configure the object
to appear as a structure, one field stores the specified breakpoint
set data and one scalar field stores the number of elements in the
breakpoint set data. You can configure the structure type name, the
field name, and other characteristics by using the properties of the
object.
To package lookup table and breakpoint set data into a single
structure in the generated code, for example, for STD_AXIS code generation,
use a Simulink.LookupTable
object to store all of
the data. See Package Shared Breakpoint and Table Data for Lookup Tables.
BpSet = Simulink.Breakpoint
returns a Simulink.Breakpoint
object
named BpSet
with default property values.
To create a Simulink.Breakpoint
object by using the Model Explorer, use the
button on the toolbar. The default name for the object is
Object
.
The breakpoint set information. You can configure these characteristics:
Specification to enable tuning the effective size of the table
in the generated code. If you select this option, in the generated
code, the Simulink.Breakpoint
object appears as a
structure variable. The structure has one field to store the breakpoint
vector data and one field to store the number of elements in the breakpoint
vector. You can change the value of the second field to adjust the
effective size of the table.
If you clear this option, the Simulink.Breakpoint
object
appears in the generated code as a separate array variable instead
of a structure.
Breakpoint set data. Specify a vector with at least two elements.
You can also use an expression with mathematical operators such
as sin(1:0.5:30)
as long as the expression returns
a numeric vector. When you click Apply or OK,
the object executes the expression and uses the result to set the
value of this property.
When you set Data type to auto
,
to set Value, use a typed expression such as single([1
2 3])
or use the fi
(Fixed-Point Designer) constructor
to embed an fi
object.
You can edit this data by using a more intuitive interface in a lookup table block. See Import Lookup Table Data from MATLAB.
Data type of the breakpoint set. The default setting is
auto
, which means that the breakpoint
set acquires a data type from the value that you specify in
Value. If you use an untyped
expression such as [1 2 3]
to set
Value, the breakpoint data use the
data type double
. If you specify a typed
expression such as single([1 2 3])
or an
fi
object, the
breakpoint data use the data type specified by the
expression or object. Enumerated data types are also
supported.
You can explicitly specify an integer data type, half data
type, a floating-point data type, a fixed-point data type,
or a data type expression such as the name of a Simulink.AliasType
object.
For more information about data types in Simulink®, see Data Types Supported by Simulink. To decide how
to control the data types of table and breakpoint data in
Simulink.LookupTable
and Simulink.Breakpoint
objects, see Control Data Types of Lookup Table Objects (Simulink Coder).
Dimension lengths of the breakpoint set.
To use symbolic dimensions, specify a character vector. See Implement Dimension Variants for Array Sizes in Generated Code (Embedded Coder).
Minimum value of the elements in the breakpoint set. The default
value is empty, []
. You can specify a numeric,
real value.
For more information about how Simulink uses this property, see Specify Minimum and Maximum Values for Block Parameters.
Maximum value of the elements in the breakpoint set. The default
value is empty, []
. You can specify a numeric,
real value.
For more information about how Simulink uses this property, see Specify Minimum and Maximum Values for Block Parameters.
For Simulink.Breakpoint
objects with a fixed-point data type, the minimum value of
the elements in the breakpoint set, specified as a stored
integer value. The value is derived from the real-world
value Min. This property is available
only in the property dialog box.
For Simulink.Breakpoint
objects with a fixed-point data type, the maximum value of
the elements in the breakpoint set, specified as a stored
integer value. The value is derived from the real-world
value Max. This property is available
only in the property dialog box.
Physical unit of the elements in the breakpoint set. You can
specify text such as degC
. See Unit Specification in Simulink Models.
Name of a structure field in the generated code. This field
stores the breakpoint set data. The default value is BP
.
To change the field name, specify text.
This column appears only if you select Support tunable size.
Name of a structure field in the generated code. This scalar
field stores the length of the breakpoint set (the number of elements),
which the generated code algorithm uses to determine the size of the
table. To tune the effective size of the table during code execution,
change the value of this structure field in memory. The default name
is N
. To change the field name, specify text.
This column appears only if you select Support tunable size.
Description of the breakpoint set. You can specify text such
as This breakpoint set represents the pressure input
.
Storage class of the structure variable (if you select Support
tunable size) or array variable in the generated code.
The variable stores the breakpoint set data. The default setting is Auto
.
For more information about storage classes, see C Code Generation Configuration for Model Interface Elements (Simulink Coder).
If you have Embedded Coder®, you can choose a custom storage class. For information about custom storage classes, see Organize Parameter Data into a Structure by Using Struct Storage Class (Embedded Coder).
Alternative name for the variable in the generated code. The default value
is empty, in which case the generated code uses the name of the Simulink.Breakpoint
object as the name of the
variable. To set the identifier, specify text.
To enable this property, set Data definition: Storage
class to a setting other than
Auto
.
Data alignment boundary in the generated code. The starting
memory address for the data allocated for the structure or array variable
is a multiple of the value that you specify. The default value is -1
,
which allows the code generator to determine an optimal alignment
based on usage.
Specify a positive integer that is a power of 2, not exceeding 128. For more information about using data alignment for code replacement, see Data Alignment for Code Replacement (Embedded Coder).
Name of the structure type that the structure variable uses in the generated code. The default value is empty. Specify text.
This property appears only if you select Support tunable size.
Scope of the structure type definition (imported from your handwritten
code or exported from the generated code). The default value is Auto
.
When you select Auto
:
If you do not specify a value in the Struct
Type definition: Header file box, the generated code exports
the structure type definition to the file
. model
_types.h
is
the name of the model.model
If you specify a value in the Struct Type
definition: Header file box, such as myHdr.h
,
the generated code imports the structure type definition from myHdr.h
.
To explicitly specify the data scope:
To import the structure type definition into the generated
code from your custom code, select Imported
.
To export the structure type definition from the generated
code, select Exported
.
If you do not specify a value in the Struct Type definition:
Header file box, the generated code imports or exports
the type definition from or to
. StructName
.h
is
the name that you specify with the property Struct Type
definition: Name.StructName
This property appears only if you select Support tunable size.
Name of the header file that contains the structure type definition. You can import the definition from a header file that you create, or export the definition into a generated header file. To control the scope of the structure type, adjust the setting for the Struct Type definition: Data scope property.
This property appears only if you select Support tunable size.
Handle. To learn how handle classes affect copy operations, see Copying Objects.
Create a Simulink.Breakpoint
object
named myBpSet
.
myBpSet = Simulink.Breakpoint
Specify the breakpoint data.
myBpSet.Breakpoints.Value = [-2 -1 0 1 2];
Create a Simulink.LookupTable
object named FirstLUTObj
.
FirstLUTObj = Simulink.LookupTable;
Specify the table data.
FirstLUTObj.Table.Value = [1.1 2.2 3.3 4.4 5.5];
Set first FirstLUTObj
to
Reference
.
FirstLUTObj.BreakpointsSpecification = 'Reference';
Configure the lookup table object to refer to the breakpoint set object.
FirstLUTObj.Breakpoints = {'myBpSet'};
Create another Simulink.LookupTable
object
to store a different set of table data. Configure the lookup table
object to refer to the same breakpoint set object.
SecondLUTObj = Simulink.LookupTable; SecondLUTObj.Table.Value = [1.2 2.3 3.4 4.5 5.6]; SecondLUTObj.BreakpointsSpecification = 'Reference'; SecondLUTObj.Breakpoints = {'myBpSet'};
You can use FirstLUTObj
and SecondLUTObj
to
specify the table data in two different Interpolation
Using Prelookup blocks. Use myBpSet
to
specify the breakpoint set data in one or two Prelookup blocks
that provide the inputs for the Interpolation Using Prelookup blocks.
You cannot subclass Simulink.Breakpoint
or Simulink.LookupTable
.
For this reason, you cannot apply custom storage classes other than
those in the built-in Simulink
package.
You cannot use Simulink.Breakpoint
objects
or Simulink.LookupTable
objects that refer to Simulink.Breakpoint
objects
as instance-specific parameter data for reusable components. For example,
you cannot use one of these objects as:
A model argument in a model workspace or a model argument value in a Model block.
The value of a mask parameter on a CodeReuse Subsystem block.
The value of a mask parameter on a subsystem that you reuse by creating a custom library.
However, you can use standalone Simulink.LookupTable
objects,
which do not refer to Simulink.Breakpoint
objects,
in these ways.
You cannot generate code according to the FIX_AXIS style.
When blocks in a subsystem use Simulink.LookupTable
or Simulink.Breakpoint
objects,
you cannot set data type override (see Control Fixed-Point Instrumentation and Data Type Override)
only on the subsystem. Instead, set data type override on the entire
model.
Simulink.LookupTable
| Simulink.lookuptable.Breakpoint
| Simulink.lookuptable.StructTypeInfo
| Simulink.lookuptable.Table
| Simulink.Parameter