how to pass MACROS to embedded code generated
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I need to pass MACROS to my embbeded code generated with Real-Time Workshop. Macros like this:
NUMST = 2
NCSTATES = 0
BUILDARGS = GENERATE_REPORT=0 PORTABLE_WORDSIZES=0 GENERATE_ASAP2=0 OPTS="-DRT -DUSE_RTMODEL -DERT"
MULTITASKING = 1
INTEGER_CODE = 0
Thanks in advance
댓글 수: 0
답변 (1개)
TAB
2012년 1월 17일
Define these MACROS as Simulink.Parameter object. Set the storage class of these parameters to Custom|ImportFromFile with header file name which contains defination of these macros.
For example
NUMST = Simulink.Parameter;
NUMST.Value = 2;
NUMST.RTWInfo.StorageClass = 'Custom';
NUMST.RTWInfo.CustomStorageClass = 'ImportFromFile';
NUMST.RTWInfo.CustomAttributes.HeaderFile ='YourMacroHeaderFile.h';
Load these parameters in base workspace with the model in which they are used before model simulation and code generation.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Model Configuration Set Customization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!