C++ to Simulink S function block

2 visualizaciones (últimos 30 días)
Prash Kd
Prash Kd el 22 de Jul. de 2020
Comentada: Prash Kd el 24 de Jul. de 2020
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.

Respuesta aceptada

Arun Kumar
Arun Kumar el 23 de Jul. de 2020
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 comentario
Prash Kd
Prash Kd el 24 de Jul. de 2020
Thanks Arun. the link you've shared has complete workflow of C/C++ -> Matlab script wrapper -> Simulink block. Will give this a try

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Device Driver Blocks en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by