How to add waitbar to matlab gui with daq?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I'm making a gui to control sending signals through a daq system from ni.
Sending a signal through the system and reciving it back takes time, and im tying to make this time visible through a waitbar.
Now i've looked up some examples on how to use waitbar and how to embedded it with gui, but i didn't learn much and it still complicated to me.
Here is a section of the program:-
%----------------------------------------------------------------------------
addinput(dq, "Dev2", "ai10", "Voltage");
addoutput(dq, "Dev2", "ao0", "Voltage");
TEST =A* chirp(t,x1,t1,x2);
%--------------------
axes(handles.axes1);
ao=TEST.*t
plot(t, ao,'linewidth',2);
grid on
title('Signal im Zeitbereich')
xlabel('t (s)')
ylabel('A (V)')
%----------
setappdata(0 ,'TEST',TEST)
setappdata(0 ,'t',t)
%----------
ao=ao'
data=readwrite(dq,(ao));
axes(handles.axes2);
plot(data.Time, data.Variables,'linewidth',2 )
title('Daten im Zeitbereich')
xlabel('t (s)')
ylabel('A (V)')
grid on
%----------
setappdata(0 ,'Data',data)
%----------
%----------------------------------------------------------------------------
If needed i can also attach the full program.
Regards,
Ali
5 件のコメント
Rik
2022 年 2 月 16 日
編集済み: Rik
2022 年 2 月 16 日
Did you read the link I posted? Did you read the documentation for the patch function? If you simply have one side of an axes filled with a color, that looks like a progress bar. There are probably also dozens of progress bars on the file exchange.
As for the data: did you read the link I posted? Did you read the documentation for the guidata function? Or for the setappdata function?
It works fine for now, but once you run a second instance it will cause strange problems. Or if you create a second thing and run both of them at the same time. The fact that it works now is not really related to the whether it is a good idea.
Everybody starts out as a beginner. It is your choice whether you want to stay a beginner. Read the documentation and read the links with long advice threads. They contain a lot of advice.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dialog Boxes についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!