Compiling a single file for multiple Sfun

조회 수: 4 (최근 30일)
talha ses
talha ses 2024년 9월 13일
답변: Sreeram 2024년 9월 16일
I want multiple sfun blocks to use a common C file in Simulink, but I get an error. Is this kind of usage possible ?

답변 (1개)

Sreeram
Sreeram 2024년 9월 16일
Hi Talha,
The issue you are facing likely arises from shared static or global memory, which can cause conflicts when multiple S-function instances are used in the same model.
To resolve this, you can use "DWork" vectors. "DWork" vectors allow each instance of an S-function to have its own separate memory block. This prevents data from one instance from overwriting data in another, thereby avoiding simulation errors or incorrect results.
You may read more about the "DWork" vectors here:
I hope it helps!

카테고리

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