Generating S-Function gives ERROR with Variable Size Signal

1 view (last 30 days)
Agam Srivastava
Agam Srivastava on 30 Sep 2021
Commented: Salini S Nair on 8 Oct 2021
I am trying to generate S-function for my model and it is failing with ERROR as Support for Variable Size Signal is Turned Off.
However, I dont see the option to enable that Option for generating S-function. I have already tried the following:
  1. Setting Model Referencing > Propagate sizes of Variable-size signal to During Execution.
  2. Selecting Variable Size Signals in Code Generation > Interface
I am not sure how I can enable Support for Variable Size signal for Generating S-function.
Attached is the screenshot of the Issue.

Answers (1)

Salini S Nair
Salini S Nair on 6 Oct 2021
I understand that you are getting an error while generating S-function which uses variable-size signal.
The examples given in the following link demonstrate how the S-function blocks can be enabled to propagate variable-size signal:
The following documentation provides details on the properties of the S-function block that need to be varied to allow the use of variable-size signals:
In addition, refer to the following documentation for details on how variable-size signals are handled in Simulink and which blocks in Simulink support them:
  2 Comments
Salini S Nair
Salini S Nair on 8 Oct 2021
You can try setting the Variable-size signal attribute of the Outport to Yes and see if it resolves the issue. This can be done by right clicking on the block (Outport) and accessing Block properties > Signal Attributes > Variable-size signal: Yes.
Variable size signals are generally supported in S-functions but also depend on the actual block implementation. It would be helpful if you could share the model or the detailed workflow. It will help in getting more insights.
In addition, please feel free to contact technical support by creating a service request so that we can assist you in resolving your issue.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!