How to pas lifedata to an editfield in app designer

1 view (last 30 days)
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 Comment
Jim Joy
Jim Joy on 6 Sep 2017
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

Sign in to comment.

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!