GUI for Simulink realtime indication

1 Ansicht (letzte 30 Tage)
Marco Wu
Marco Wu am 9 Aug. 2011
Hi,
I am using Simulink realtime workshop to control a device; and I want to know the direction of movement of that device. I understand that I can use scope to read the exact data value, but I would want to use a red light to indicate a negative direction and green light for positive direction. How I can set the gui to do that? I know how to make gui update according to the workspace value, can anyway to send values to workspace every 0.05s when I am using realtime workshop?
Thanks

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 9 Aug. 2011
I think you have some misunderstanding. Simulink Real-Time Workshop is used to generate C code from a Simulink model. The C code then can be compiled and executed in a micro-processor. It is hard to control a hardware device directly in Simulink to achieve real-time control.
Are you doing your simulation in a Simulink model or in a MATLAB GUI? If in a Simulink model, the Scope block is used to observe a signal. There is a Gauges Blockset that provides LEDs to display Green/Red light. http://www.mathworks.com/products/gauges/?s_cid=global_nav
  2 Kommentare
Marco Wu
Marco Wu am 9 Aug. 2011
Thanks for your reply.
I use Simulink realtime workshop for data acquisition and real time control of some physical devices in my biomedical experiment.
Do you use LabVIEW? What I want is to create a simple GUI like the LabVIEW panel. I only need to have a virtual on screen red light (on when volt > 5V) which is controlled by the real time data acquisition. What I can do is to physically use a LED and connection to the digital output in my PCI card. HOWEVER, it is not a good option for me.
Fangjun Jiang
Fangjun Jiang am 9 Aug. 2011
Simulink is not like LabView. I don't think you can use Simulink for real-time control of your physical devices. To make the virtual LED display, the Gauges Blockset is the right tool.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by