Compatibility of Matlab 2017b S-function C-Code on a HIL D-Space setup that is using Matlab 2017a?

1 ビュー (過去 30 日間)
Our oganization only has Matlab 2017b and we are creating s-functions of our simulink model where one of the artifacts that gets auto-generated is C-code to be delivered to a customer who is using them on a HIL D-space system that is using Matlab 2017a. The customer is experiencing incompatibilities between our 2017b s-function code and their 2017a system. There is no means for either organization to align their matlab versions with the others.
Hoping to learn if there are any workarounds for getting our 2017b built s-function code working on their 2017a system. We have also tried exporting the actual 2017b s-function model into 2017a format which works for the model use, but this solution does not help for the c-code.
Anyone have any ideas?

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2022 年 8 月 19 日
The best way is for you to export R2017b version model to a R2017a version model so your customer can use it. Of course, that requires to disclose the contents of the model, which you might not be allowed to do.
The second option is to provide the generated C code to your customer so they can build the S-function in R2017a. If they need to run the model in dSpace real-time target, then C code is required. Providing R2017b version of S-function (.dll or .mex) file is not sufficient even if it could be run in R2017a in model simulation.
The third option is to consider Create Proteced Model. R2017b might not have it. I don't remember which release starts to have it. It also requires them to be able to "use generated code".
Disclosing the generated C code may not be as serious as disclosing the model, if you don't include comments in the generated code.
  2 件のコメント
Fangjun Jiang
Fangjun Jiang 2022 年 8 月 19 日
You've already done the option two I mentioned. Technically it is feasible but the devil is in the details. I certainly understand the problem regarding "incompatibilities with toolbox header files". That is why the Mathworks is now working on being able to integrate generated code from different releases.
I would suggest contacting tech support to resolve the issue. Depending on the actual compiling errors, there might be a way to resolve it.



Find more on Model Compatibility in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by