C++ to Simulink S function block

조회 수: 3 (최근 30일)
Prash Kd
Prash Kd 2020년 7월 22일
댓글: Prash Kd 2020년 7월 24일
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에서 Device Driver Blocks에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by