I am using Matlab R2020b and have a Raspberry Pi 4 Model B. I flashed the Pi's SD-card with "mathworks_raspbian_R20.2.3.zip".
I have a model that I can run on the Raspberry Pi by choosing the Raspberry Pi in the Hardware Settings and then either clicking "Build, Deploy & Start" or "Monitor & Tune". Both works fine.
However, I would now like to have more control over the program that is now running on the Pi. For example, I would like to access certain variables' values so that I can send this data to a small LCD-Display connected to the Pi.
My question therefore is: Where do I find and how do I access (on the Raspberry) variables from my Simulink model when it is executed on the Raspberry Pi?
Background to this question ist, that Simulink's library browser has not all the Raspberry Pi blocks that I need. For example, I would like to use a small display but I cannot control it with any of the Simulink blocks because this block just doesn't exist. Apparently, you can build your own block (S-Function) and then integrate it to your Simulink Model. However, I am not very experienced with that and would like to find an alternative way. As the alternative, I would like to devide my project into two parts:
1) Build & deploy the model on the Raspberry Pi (as usual)
2) Having the Raspberry now run standalone and access variables (with a program on the Raspberry) from the model to send them to other applications
Additionally, the following questions are related to my problem, so if anyone has answers to them, I am sure that would be of great help as well:
- What exactly happens, when I press "Build, Deploy & Start"? Which file is executed on the Pi and with which program?
- In case I would already be able to extract a variable from a Simulink model that is running on Raspberry Pi: How could I display it on the Raspberry GUI (like the Scope in Simulink).
Thank you very much for your help!