How to pas lifedata to an editfield in app designer
조회 수: 3 (최근 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
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 Exchange에서 Signal Integrity Kits for Industry Standards에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!