Connecting TI hardware with MATLAB GUI

14 次查看(过去 30 天)
Neil
Neil 2025-3-13
回答: Amish 2025-3-26
We have made a Simulink model to read ADC and generate a PWM for TI F280049C/TI F28379D launchpad, and using the monitor and tune feature to get real time reading from the ADC.
How to link the MATLAB GUI such that when the GUI model is run, it runs the code on the hardware and is able to get real time data from the ADC and even send data continuosuly to the launchpad in real time? (eg. running a PI controller and sending the reference value from the GUI to the microcontroller and reading the feedback ADC value from the microcontroller in the GUI).

回答(1 个)

Amish
Amish 2025-3-26
Hi Neil,
To link a MATLAB GUI with a Simulink model running on TI hardware such as the F280049C or F28379D LaunchPad, you'll need to integrate real-time data exchange between the GUI and the hardware. This can be done using Simulink's External Mode and MATLAB's App Designer.
For implementing this, you would need to Configure your Simulink model for 'External Mode' simulation and choose an appropriate Hardware Implementation for your TI Board. Then, you can configure the communication interface in the 'External Mode Control Panel'. Typically, for TI Boards, it is a serial interface. You can then build the model to generate and deploy code on the hardware.
The next part would be to setup the GUI. You can use MATLAB App Designer to create a GUI with controls for sending reference values and displaying feedback from the ADC. You will need to setup certain callacks corresponding to the GUI controls for sending the information. set_param can be used to change parameters in the Simulink model from the GUI. To recieve the information and real-time data, consider using a 'To Workspace' block in the Simulink model to send ADC values to the MATLAB workspace.
After you have setup and configure the Simulink as well as your MATLAB App, you can run the Simulink model in External Mode to start the code execution on the hardware and then use the GUI to send reference values and observe real-time ADC feedback.
The following documentations might be helpful for you:
Hope this helps!

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by