| Real-Time Workshop® Embedded Coder™ | ![]() |
Create TFL function entry based on specified parameters and register in TFL table
TflCFunctionEntry* registerCFunctionEntry(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. The name must match one of the functions supported for replacement:
| abs | ceil | floor | sinh |
| acos | cos | log | sqrt |
| asin | cosh | log10 | tan |
| atan | exp | sin | tanh |
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, if functionName is 'sqrt', implementationName can be 'sqrt' 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 function entry.
The registerCFunctionEntry function provides a quick way to create and register a TFL function 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
In the following example, the registerCFunctionEntry function is used to create a function entry for sqrt in a TFL table.
hLib = RTW.TflTable;
hLib.registerCFunctionEntry(100, 1, 'sqrt', 'double', 'sqrt', ...
'double', '<math.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
![]() | model_terminate | registerCPromotableMacroEntry | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |