How to pas lifedata to an editfield in app designer

1 次查看(过去 30 天)
Hello. I´m collecting data over time with NI myDAQ device and wants to display it an app. I created an app with the app designer and the ploting works well.
But how do I display the voultagevalue in an edite field. Her the main code:
if true
global s
s = daq.createSession('ni'); %kreiert eine Session
addAnalogInputChannel(s,'myDAQ1', 0, 'Voltage'); %Kanalinitialisierung
addAnalogInputChannel(s,'myDAQ1', 1, 'Voltage');
s.Rate = 10000; %frewuenz
s.IsContinuous = true; %kontinuihrlich Daten aufnehmen
global lh;
global lk;
lh = addlistener(s,'DataAvailable',@plotData); %Listener fuer Punkt
lk = addlistener(s,'DataAvailable',@plotData2); %Listener fuer Spannungskennlinien
s.startBackground(); %Datenaufnahme/-Verarbeitung laueft weiter im Hintergrund
function plotData(src, event) %plottet den Punkt
global data;
data = event.Data; %Datenübergabe
plot(app.Punkt,data(:,1)-2.55,data(:,2)-2.5,'*','Linewidth',12)
end
function plotData2(src, event) %Spannungskennlinien
%disp(event.Data)
global data;
data = event.Data;
plot(app.X_Achse,data(:,1),'Linewidth',1);
plot(app.Y_Achse,data(:,2),'r','Linewidth',1);
%disp(app.SpannungYAchseEditField, data(:,2))
end
end
As You can see I tryed it wicht %disp(app.SpannungYAchseEditField, data(:,2)), it doesent works. Then I tryed it with private property but it doesent worked out asa well. How do I display it? Pls. help
  1 个评论
Jim Joy
Jim Joy 2017-9-6
Hi Vitali,
To clarify, when you say that you want to display it in your App, do you want to display it in a text box in the App? What is your text box called in the code for the App?
Thanks,
Jim

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by