How to pas lifedata to an editfield in app designer

1 回表示 (過去 30 日間)
Vitali Walter
Vitali Walter 2017 年 9 月 4 日
コメント済み: Jim Joy 2017 年 9 月 6 日
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 Center および File ExchangeSignal Integrity Kits for Industry Standards についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by