Simulink Truthtable block with Action language as C

조회 수: 1 (최근 30일)
Arunkumar Muthukumaran
Arunkumar Muthukumaran 2015년 7월 3일
답변: Shubham 2024년 10월 17일
Is it possible to set Action language to C in Simulink Truthtable block? For truth tables used in Stateflow model, there is an option to select Action Language. But this option is not available for Simulink Truthtable block.
Is it a limitation or is there any possibility to set it to C language?

답변 (1개)

Shubham
Shubham 2024년 10월 17일
Hey Arunkumar,
As far as I understand, unlike Stateflow charts, where you can set the action language to C or MATLAB, the Truth Table block in Simulink does not provide an option to choose the action language as C directly. The primary reason is that the Truth Table block is intended to be a high-level abstraction for decision logic, which is typically implemented using MATLAB for ease of use and integration within the Simulink environment.
If you need to use C as the action language for decision logic, I would suggest you the following:
  • Use Stateflow charts instead of a Truth Table block, and set the action language to C as you have already mentioned.
  • Use a custom S-Function block with the logic written in C to be used in Simulink. This would give you flexibility to write C code but requires some more effort to implement.
  • You can also use the Legacy code tool to integrate existing C functions in Simulink.
I hope this helps!

카테고리

Help CenterFile Exchange에서 Verification, Validation, and Test에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by