C2000: Viewing variables in Simulink and Embedded Coder
13 views (last 30 days)
Show older comments
I am using Simulink + Embedded Coder to generate test code for the F28379D processor (one of the targets in the C2000 toolbox). I can generate and upload code with no problems.
Now, I have the ADCs setup, and I want to view the ADC results as the code is running in real time (like using a debugger to view an ADC result in the watch window). How can I do this in Simulink?
1 Comment
Manikanta Aditya
on 4 Apr 2024
In Simulink, you can view the ADC results in real-time using the Display block.
Accepted Answer
Ayush Anand
on 4 Apr 2024
Edited: Ayush Anand
on 4 Apr 2024
Hi Richard,
Viewing ADC results in real-time as your code generated from Simulink is running on a Texas Instruments F28379D processor can be achieved through various methods within the Simulink environment. Here are some possible approaches:
External Mode: External mode allows you to run your model on the target hardware and view parameters in real-time from Simulink on your host PC. You can run the model in external mode by following the steps below:
- Configure External Mode: You can do this by going to the model's Configuration Parameters (Simulation > Model Configuration Parameters), under the "Hardware Implementation" settings. Set the "Hardware board" to your specific target (F28379D), and then in the "External Mode" section, ensure that external mode is enabled.
- Signal Logging: Use signal logging to monitor ADC results. Right-click on the signal in your model and select "Log Selected Signals".
- Run in External Mode: Connect your hardware to your PC, and then run your model in external mode by clicking on the external mode button in Simulink's toolbar. Your model will now run on the hardware, and you should be able to see your logged signals in real-time in Simulink.
Dashboard Blocks: Simulink's Dashboard blocks allow you to add interactive controls and displays to your model. You can setup dashboard blocks following the steps below:
- Add Dashboard Blocks: From the Simulink Library Browser, find the Dashboard blocks (e.g., Gauges, Displays) and add them to your model. Connect them to the signals you want to monitor.
- Configure for External Mode: Ensure your model is set up for external mode as described above.
- Run and Monitor: Run your model in external mode and observe the ADC results on the dashboard blocks in real-time as the code executes on the hardware.
Data Inspector: The Simulink Data Inspector allows you to view and analyze data from your model in real-time.
- Enable Data Streaming: For the signals you want to monitor, enable streaming to the Data Inspector. This can be done by right-clicking the signal and selecting "Stream signal to Data Inspector".
- Run in External Mode: With your model configured for external mode, run it. Open the Data Inspector to view the streamed signals in real-time.
You can read more about running Simulink in external mode here:
Hope this helps!
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!