How can I re-use Simulink code using PLC Coder?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I've got a Simulink model which uses model referencing quite a bit. One example is a button debounce model which is being referenced quite often in my top-level model. Model references are awesome: I can change the code, and all references will change along with it.
Now I'm converting my model to be used with Simulink PLC Coder, but that doesn't support model referencing.
Reading the MathWorks pages with PLC Coder supported blocks, I found the following statement: "A code reuse subsystem is a Subsystem block with the parameter Treat as atomic unit selected and the parameter Function packaging set to Reusable function"
Question:
Say I've got 10 button debounce model references in my current model. I just replaced all model references with regular subsystems, according to the beforementioned instructions. Now I decide to refactor the button debounce code. Does that mean I have to manually go through all 10 button debounce subsystems to update them?
This seems to go agains general coding best practices and seems to be rather error-prone. I have the feeling I'm missing something here. Does anyone know a better way to do this?
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Simulink PLC Coder dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!