Validate is there is an s-function in the Simulink model with embedded coder
이전 댓글 표시
We have 2 simulink models that we convert to C++. In one simulink model we have a non-inlineable S-function. The S-function in C++ performs dynamic allocation therefore we need to check whether or not the dynamic allocation at startup has been succesful. We do something like this
for (int i = 0; i < rtM->Sizes.numSFcns; i++) {
SimStruct* rts = rtM->childSfunctions[i];
if (ssGetErrorStatus(rts) != (NULL)) {
error = true;
//TODO : Implement strncpy_s
strncpy(infoMsg, ssGetErrorStatus(rts), 100);
}
}
However, in the 2nd model, we don't have an S-function and the above code fails. Is there a way to check whether or not there's an S-function in the Simulink model either using TLC or other options in embedded coder?
we cannot use the regular initialize C++ function as the function has no return arguments and we cannot know whether or not it has failed.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Simulink Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!