Import Data from Simulink Model into Gui

조회 수: 1 (최근 30일)
Thomas
Thomas 2014년 8월 21일
댓글: Mina As 2016년 5월 21일
Hello, im trying to get Simulink data into my GUI. I have no problem to control my Simulink-Model via the set_param command. My Simulink model sends data from subsystem via outport/inport-block into a sink (display or scope).
The Data is a simple counter starting @ 1. Now i want to catch this data and connect it with my GUI to show it in statictext field.
I failed to use the get_param: get_param('Model/Out1','...') because there is no parameter which provides me with the counter information.
I googled a lot and found add_exec_event_listener.I integraded the listener to the simstart button, so if the listener registeres, the simulation is already running. but it doesnt work:
blk = 'test/In1';
event = 'PostOutputs';
listener = @updategui;
h = add_exec_event_listener(blk, event, listener);
after that i thouight i can simply update the edittext via:
set(handles.text,'h')% code
You see i am stuck using this command. I also dont know if i can register a listener to a Inport or a Sink. Can you please help me? Thomas
  댓글 수: 1
Mina As
Mina As 2016년 5월 21일
I'm trying to get gui data into my simulink but i dont know how,anyone knows?

댓글을 달려면 로그인하십시오.

채택된 답변

A Jenkins
A Jenkins 2014년 8월 21일
There is a good example on the File Exchange that you can download to learn how to do it.
There is also a discussion here.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Inputs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by