Dynamic Port- and Parametersizes in S-Function after creating objectcode

1 view (last 30 days)
Hello everybody,
I already know how to use "dynamic" sizes of ports and parameters. For parameters it's clear, just type sth. like: #define ConductionC ( (real_T*) (mxGetPr(ssGetSFcnParam(S,0))))
and you will have a pointer on an array instead of one single value. With ports it's a bit more difficult. But you can type: #define Current ((real_T *) ssGetInputPortRealSignal(S,0))
which defines the port as one containing more than one value. Afterwards you can use a parameter value to define the portsize inside the mdlInitializeSizes Function with the command: ssSetInputPortWidth(S, 0, portWidth);
Now this works fine in a MiL surrounding. But my question is, what will happen if I build the model with the rtw and use the resulting objectcode? Will the ports with a different port size parameter still work fine or has the objectcode a fixed space defined for this pointer now? And how is it with the parameters? Fixed arraysize in objectcode or can I still change the parametrization m-file, rebuild the model (without the objectcode of the S-functions) and all parameters will work fine without space validations?
I am asking this, because I can not give our c-code to our customers. This objectcode questions affects of course only the S-functions. the model structure can still be opened and changed.
I hope, anybody has experience in this topic and answer my questions. Thanks in advice!

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!