C++ to Simulink S function block

1 次查看(过去 30 天)
Hi all,
New matlab user here.
I am currently working on a Arduino project which requires interfacing controller with multiple input and output devices. There already a vast C++ library available in Arduino IDE for all these devices and i'd like to convert them to Simulink S block so i can program / monitor / control them directly from Simulink. There's a way to use standard Arduino simulink peripheral library to interface with these devices and then implement math/logic to convert incoming data to appropriate format however I'd prefer to focus on devloping good control algorithm rather then on creating new peripheral libraries from scratch. So my question is - Is there a comprehensive guide that explains in detail on how to convert existing C++ libraries into s blocks ? Below is link to probably the best video i could find on internet on this subject however coming from non-oops background I'd appreciate if someone can point me to a more structured guide on this.
Note - I have already installed Arduino hadrware support and try to convert adafruit library for MAX6675 into s block. Following the guide above I can "build" the S block however I dont see any data coming in. If i add the inbuilt SPI block then i do see data coming in so i assume there is no issue with the hardware.

采纳的回答

Arun Kumar
Arun Kumar 2020-7-23
Hi Prash,
To create a device driver for Arduino, you can use the following gude:
And the detailed steps to use 3rd party library with Simulink support package are metioned in the following file exchange submission:
Hope This Helps!!
  1 个评论
Prash Kd
Prash Kd 2020-7-24
Thanks Arun. the link you've shared has complete workflow of C/C++ -> Matlab script wrapper -> Simulink block. Will give this a try

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by