Convert to code using Simcoupler

24 views (last 30 days)
jeffry
jeffry on 31 Oct 2023
Commented: Angelo Yeo on 1 Nov 2023
Attempt to convert to C Code using Simcoupler. If the conversion to code is successful, I plan to connect to the S32K144 EVB board, but the C code conversion is not successful. Note that the file currently opened and being tested is the pmsm_simulink_PWM_R2018 example file.
However, the following issues occur.
Unable to find S-function module 'SimCoupler'. S-function modules must exist as either source files or pre-compiled object files on the MATLAB path.

Answers (1)

Angelo Yeo
Angelo Yeo on 31 Oct 2023
To access the S-function in SimCoupler on Simulink, the SimCoupler must be configured with Simulink.
The SimCoupler Toolbox is not a MathWorks product; it is provided by a third-party company and you will need to purchase it separately.
Once the toolbox is purchased and configured with Simulink, you can proceed with the co-simulation workflow.
Information about SimCoupler Toolbox can be found in the following URL:
  2 Comments
jeffry
jeffry on 1 Nov 2023
I know that simcoupler is not of mathwork.
I completed the purchase separately and even completed the simulation from the matte lab. What I'm curious about is that the Matreb simulation works normally, but I'm curious about the reason why an error phrase occurs when converting the C Code. Thank you for your answer.
Angelo Yeo
Angelo Yeo on 1 Nov 2023
Thank you for your clarification. I must confess that my familiarity with the SimCoupler module is limited, and I am uncertain about the manner in which this module is provided.
If the module is delivered with a source file or pre-compiled object files, I recommend adhering to the guidance provided by the error message. Specifically, it suggests placing the files on a MATLAB path.
However, if this solution doesn't apply to your situation, I would advise reaching out to Powersim directly for further assistance. It is unclear to me whether they have considered the use of SimCoupler for code generation purposes. You can request support from Powersim through the following link: Powersim Support.

Sign in to comment.

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Tags

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!