Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Using a C++ class support library in a Simulink model
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a project where I am coding an Arduino in Simulink. Among other things, the Arduino is communicating with other devices via a CAN bus shield. The shield came with a C++ support library. This library is setup as a class with member functions for initialization of the shield, checking for errors, sending/recieving messages, etc.
I know that the S-block builder can be used to include C++ code in Simulink however if I declare the class every time the s-block is called, then the constructor for the class would be called and the shield will reinitialize. This is a problem because this would clear the buffer on the shield, erasing all the messages.
I need to find a way to declare the class somewhere in the Simulink model and then be able to call that class's member functions elsewhere in my Simulink model.
Any suggestions would be greatly appreciated, thanks.
0 commentaires
Réponses (0)
Cette question est clôturée.
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!