GUI for Simulink realtime indication

2 次查看(过去 30 天)
Marco Wu
Marco Wu 2011-8-9
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

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2011-8-9
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 个评论
Marco Wu
Marco Wu 2011-8-9
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 2011-8-9
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Block Libraries 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by