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

2 ビュー (過去 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 件のコメント
Jason Hannawa
Jason Hannawa 2022 年 8 月 19 日
Thank you for the response!
We actually provide them with the generated C-code from the 2017b constructed s-functions. They required this from us. The raw model is confidential as you correctly assumed, so we also provide them the s-function block model which can be exported into 2017a format.
It is in using the 2017b generated code on their 2017a HIL system that is flagging problems. So far it has been incompatibilities with toolbox header files and such and we really do not know where the trail of build errors will end.
In your second option, are you saying that if given the 2017b generated c-code they should be able to re-create the code in 2017a? If so, are there steps for this? Or maybe we have to seek Mathworks support.
Thanks again for your help!
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.



Help Center および File ExchangeSimulink Coder についてさらに検索




Community Treasure Hunt

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

Start Hunting!

Translated by