| Contents | Index |
arg = createAndAddImplementationArg(hEntry, argType, varargin)
Handle to a CRL table entry previously returned by instantiating a CRL entry class, such as hEntry = RTW.TflCFunctionEntry or hEntry = RTW.TflCOperationEntry.
String specifying the argument type to create: 'RTW.TflArgNumeric' for numeric.
Parameter/value pairs for the implementation argument. See varargin Parameters.
The following argument properties can be specified to the createAndAddImplementationArg function using parameter/value argument pairs. For example,
createAndAddImplementationArg(..., 'DataTypeMode', 'double', ...);
String specifying the argument name, for example, 'u1'.
String specifying the I/O type of the argument: 'RTW_IO_INPUT' for input.
Boolean value that, when set to true, indicates that the argument is signed. The default is true.
Integer specifying the word length, in bits, of the argument. The default is 16.
String specifying the data type mode of the argument: 'boolean', 'double', 'single', 'Fixed-point: binary point scaling', or 'Fixed-point: slope and bias scaling'. The default is 'Fixed-point: binary point scaling'.
String specifying the data type of the argument: 'boolean', 'double', 'single', or 'Fixed'. The default is 'Fixed'.
String specifying the data type scaling of the argument: 'BinaryPoint' for binary-point scaling or 'SlopeBias' for slope and bias scaling. The default is 'BinaryPoint'.
Floating-point value specifying the slope of the argument, for example, 15.0. The default is 1.
You can optionally specify either this parameter or a combination of the SlopeAdjustmentFactor and FixedExponent parameters, but do not specify both.
Floating-point value specifying the slope adjustment factor (F) part of the slope, F2E, of the argument. The default is 1.0.
You can optionally specify either the Slope parameter or a combination of this parameter and the FixedExponent parameter, but do not specify both.
Integer value specifying the fixed exponent (E) part of the slope, F2E, of the argument. The default is -15.
You can optionally specify either the Slope parameter or a combination of this parameter and the SlopeAdjustmentFactor parameter, but do not specify both.
Floating-point value specifying the bias of the argument, for example, 2.0. The default is 0.0.
Integer value specifying the fraction length of the argument, for example, 3. The default is 15.
Constant value specifying the initial value of the argument. The default is 0.
Use this parameter only to set the value of injected constant input arguments, such as arguments that pass fraction-length values or flag values, in an implementation function signature. Do not use it for standard generated input arguments such as u1, u2, and so on. You can place a constant input argument that uses this parameter at any position in the implementation function signature except as the return argument.
You can inject constant input arguments into the implementation signature for any CRL table entry, but if the argument values or the number of arguments required depends on compile-time information, you should use custom matching. For more information, see Refine CRL Matching and Replacement Using Custom CRL Table Entries in the Embedded Coder documentation.
Handle to the created implementation argument. Specifying the return argument in the createAndAddImplementationArg function call is optional.
The createAndAddImplementationArg function creates an implementation argument from specified properties and adds the argument to the implementation arguments for a CRL table entry.
Note Implementation arguments must describe fundamental numeric data types, such as double, single, int32, int16, int8, uint32, uint16, uint8, or boolean (not fixed point data types). |
In the following example, thecreateAndAddImplementationArg function is used along with the createAndSetCImplementationReturn function to specify the output and input arguments for an operator implementation.
op_entry = RTW.TflCOperationEntry;
.
.
.
createAndSetCImplementationReturn(op_entry, 'RTW.TflArgNumeric', ...
'Name', 'y1', ...
'IOType', 'RTW_IO_OUTPUT', ...
'IsSigned', true, ...
'WordLength', 32, ...
'FractionLength', 0);
createAndAddImplementationArg(op_entry, 'RTW.TflArgNumeric',...
'Name', 'u1', ...
'IOType', 'RTW_IO_INPUT',...
'IsSigned', true,...
'WordLength', 32, ...
'FractionLength', 0 );
createAndAddImplementationArg(op_entry, 'RTW.TflArgNumeric',...
'Name', 'u2', ...
'IOType', 'RTW_IO_INPUT',...
'IsSigned', true,...
'WordLength', 32, ...
'FractionLength', 0 );The following examples show some common type specifications using createAndAddImplementationArg.
% uint8:
createAndAddImplementationArg(hEntry, 'RTW.TflArgNumeric', ...
'Name', 'u1', ...
'IOType', 'RTW_IO_INPUT', ...
'IsSigned', false, ...
'WordLength', 8, ...
'FractionLength', 0 );
% single:
createAndAddImplementationArg(hEntry, 'RTW.TflArgNumeric', ...
'Name', 'u1', ...
'IOType', 'RTW_IO_INPUT', ...
'DataTypeMode', 'single' );
% double:
createAndAddImplementationArg(hEntry, 'RTW.TflArgNumeric', ...
'Name', 'u1', ...
'IOType', 'RTW_IO_INPUT', ...
'DataTypeMode', 'double' );
% boolean:
createAndAddImplementationArg(hEntry, 'RTW.TflArgNumeric', ...
'Name', 'u1', ...
'IOType', 'RTW_IO_INPUT', ...
'DataTypeMode', 'boolean' );createAndSetCImplementationReturn

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |