How can I run a Simulink model with a C S-Function on a Simulink Real-Time PC?

1 回表示 (過去 30 日間)
Mikhail Katliar
Mikhail Katliar 2018 年 5 月 28 日
回答済み: Jon Lobo 2018 年 7 月 3 日
I have a Simulink model with an S-Function Builder block in it. The S-Function Builder block defines a custom Outputs function and includes 2 extra C files which implement necessary functionality. I can successfully build the code for the Simulink Real-Time target, and it gets deployed on the Simulink Real-Time PC. However, after deployment, I see the following message in red in the bottom-right corner of the Real-Time PC screen:
To run the generated code outside the MATLAB environment, use the packNGo function.
I can build a .zip-file with the packNGo function, however I have no idea what to do with it and how to deploy it on the Real-Time PC.
How can I run a model with some custom C code on a Simulink Real-Time PC?
The build log and the project files are attached.

回答 (1 件)

Jon Lobo
Jon Lobo 2018 年 7 月 3 日
Hi Mikhail,
I took a look at your example. It looks like you did everything right. The only issue is that you are using the UDP Send block from the DSP Systems Toolbox. This is not supported in Simulink Real-Time.
I was able to find this by using SimulinkRealTime.utils.getConsoleLog to see the line above "To Run the generated code outside the MATLAB environment...". The line above reads "Error: Could not open library: networkdevice.dll'.
Once I removed that block and used the UDP Send from Simulink Real-Time the application worked.

カテゴリ

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

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by