How to pas lifedata to an editfield in app designer

1 visualización (últimos 30 días)
Vitali Walter
Vitali Walter el 4 de Sept. de 2017
Comentada: Jim Joy el 6 de Sept. de 2017
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 comentario
Jim Joy
Jim Joy el 6 de Sept. de 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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by