Static Functions in Real Time workshop

17 次查看(过去 30 天)
Hi,
Is it possible to generate static functions instead of extern functions when using Real Time workshop? My problem is that when two seperate real time workshop codes are combined together, errors are generated due to the function names being redundant. So I am having to manually rename the functions as static once the code is generated. Is there any method of automatically defining them as static when real time workshop is used to convert the model to C code?
Eg: The functions I have problems with are - rt_GetLookupIndex, rt_Lookup and rt_Lookup2D_Normal. These are generated by Real Time Workshop when converted to C codes and they are defined as extern instead of static, which I need.
Regards, DPac

采纳的回答

TAB
TAB 2012-3-14
These are generally utility functions which are generated with tha same name in different model. One option is that, you can generate these functions in separate file and use only this file. All model will call function from this file. To achieve this goto-
Configuration parameters> RealTime Workshop> Interface tab and select Utility function generation option as shared location.
Second and not recommended option is that, you can modify TLC file of corresponding utility functions to generate the function with unique name or as static. For example by modifying TLC you can force the RTW to generate functions with names like modelname_rt_GetLookupIndex. In this way function names will be different for different model names.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by