To obtain initializations in generated code(Embedded Coder) for each "Control input" of a variant subsystem inside a library

2 Ansichten (letzte 30 Tage)
Hello team,
I am facing one issue in the generated code of a Variant Subsystem used inside a library.
Since the library has been used for multiple instances, with different control inputs for the variant subsystem (implemented inside a library), the generated code is expected to have definitions for each of the control input based on the instance used for that particular variant subsystem.
I am able to achieve this for one default value though the other control input definitions are not shown in the generated code. I am sharing the respective code snapshot for your reference. Requesting your support to achieve expected and required definitions in the generated code.
Please guide me if there is any applicable setting or similar update is required to achieve the desired results.
  2 Kommentare
Altaïr
Altaïr am 9 Jan. 2025
Hello @Shalaka,
Based on the shared screenshot, it seems that "Control_var_VariantControlExpression" is defined as the control input that equals "Voltage". However, the phrase "definitions for each of the control input" is still unclear. Please share the model and the generated code to understand the issue better.
Shalaka
Shalaka am 13 Jan. 2025
Hello Ashok,
>>However, the phrase "definitions for each of the control input" is still unclear.
Sorry for the unclear explanation of the issue, I will try to explain it again.
The above-mentioned library (with a variant subsystem) has been used multiple times inside a model. It has different control inputs for each of these instances (please find Image_1 for reference). The code generation should contain a unique definition for each of these control inputs. However, as shared earlier, the code generates just one definition - for the default value.
>> Please share the model and the generated code to understand the issue better.
Please find attached files for your reference.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by