| Real-Time Workshop® Embedded Coder™ | ![]() |
Create TFL promotable macro entry based on specified parameters and register in TFL table (for abs function replacement only)
TflCFunctionEntry* registerCPromotableMacroEntry(hTable, priority,
numInputs, functionName,
inputType, implementationName,
outputType, headerFile,
genCallback, genFileName)
Handle to a TFL table previously returned by hTable = RTW.TflTable.
Positive integer specifying the function entry's search priority, 0-100, relative to other entries of the same function name and conceptual argument list within this table. Highest priority is 0, and lowest priority is 100. If the table provides two implementations for a function, the implementation with the higher priority will shadow the one with the lower priority.
Positive integer specifying the number of input arguments.
String specifying the name of the function to be replaced. Specify 'abs'. (This function should be used only for abs function replacement.)
String specifying the data type of the input arguments, for example, 'double'. (This function requires that all input arguments are of the same type.)
String specifying the name of your implementation. For example, assuming functionName is 'abs', implementationName can be 'abs' or a different name of your choosing.
String specifying the data type of the return argument, for example, 'double'.
String specifying the header file in which the implementation function is declared, for example, '<math.h>'.
String specifying '' or 'RTW.copyFileToBuildDir'. If you specify 'RTW.copyFileToBuildDir', and if this function entry is matched and used, the function RTW.copyFileToBuildDir will be called after code generation to copy additional header, source, or object files that you have specified for this function entry to the build directory. For more information, see Specifying Build Information for Function Replacements in the Real-Time Workshop® Embedded Coder™ documentation.
String specifying ''. (This argument is for use only by MathWorks developers.)
Handle to the created TFL promotable macro entry.
The registerCPromotableMacroEntry function creates a TFL promotable macro entry based on specified parameters and registers the entry in the TFL table. A promotable macro entry will promote the output data type based on the target word size.
This function provides a quick way to create and register a TFL promotable macro entry. This function can be used only if your TFL function entry meets the following conditions:
All input arguments are of the same type.
All input argument names and the return argument name follow the default Simulink® naming convention:
For input argument names, u1, u2, ..., un
For return argument, y1
Note This function should be used only for abs function replacement. Other functions supported for replacement should use registerCFunctionEntry. |
In the following example, the registerCPromotableMacroEntry function is used to create a function entry for abs in a TFL table.
hLib = RTW.TflTable;
hLib.registerCPromotableMacroEntry(100, 1, 'abs', 'double', 'abs_prime', ...
'double', '<math_prime.h>', '', '');Alternative Method for Creating Function Entries in the Real-Time Workshop Embedded Coder documentation
Creating Function Replacement Tables in the Real-Time Workshop Embedded Coder documentation
Target Function Libraries in the Real-Time Workshop Embedded Coder documentation
![]() | registerCFunctionEntry | runValidation (AUTOSAR) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |