Real Time workshop static variables?

Hi,
I am using real time workshop to convert two separate and independent simulink models to C files, to be used on the same piece of hardware (integrated into another C file). The problem I have is that both these models have look up tables in them and when their respective C codes are integrated into one big C code, errors are generated (due to variable names being redundant).
So currently I am having to manually change the 'extern' variables (like extern int_T rt_GetLookupIndex) into 'static' before compiling the final C code. These variables are generated during the conversion of the simulink model into C.
Is there any way of automatically setting these variables as static when you use Real Time workshop to convert them to C? As in is there any way of defining these look up tables to be used only till the end of the respective C code? The look up tables values are defined in the matlab before using real time workshop to convert them to C.
Regards, DPac

 採用された回答

Kaustubha Govind
Kaustubha Govind 2012 年 3 月 7 日

0 投票

You need to define a Custom Storage Class and apply it to the relevant signals/parameters. Once you have defined a Custom Storage Class, simply specify static as the qualifier.

1 件のコメント

Dpac
Dpac 2012 年 3 月 8 日
Thank you very much for the response!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by