Using Simulink to run a portion of a model on hardware in external mode
10 views (last 30 days)
Show older comments
I am trying to use a raspberry pi to run only a section of a Simulink model. It is now running in an external mode simulation on the raspberry pi but this runs all of the model on the hardware. I am trying to figure out the best way to have the hardware run a portion of the code and have this send information to a second Simulink simulation, and vice versa, in real time.
Some of what I have tried is saving to the base workspace from the external mode simulation but it seems like in external mode the Simulation can not save to the workspace in real time using a MATLAB function block with the assignin() function. Can you use the base workspace as a way to share values between the model on the hardware and the model on the computer as they are running?
I tried using a referenced model but it did not have external mode as a simulation mode. It did have PIL and SIL but with these there is an error that says the model is not derived from an ERT or GRT system target file. Can you run a referenced model in external mode on a raspberry pi?
2 Comments
Ned
on 8 Apr 2021
Hi Michael,
PIL will be suitable solution for you.
Can you please provide more info regarding the error message in your PIL workflow?
Did you referred the example Code Verification and Validation with PIL and External Mode
-Reeno
Answers (0)
See Also
Categories
Find more on Run on Target Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!