Appdesigner Real Time Data Acquisiton&Dİsplay

3 visualizzazioni (ultimi 30 giorni)
mehmet kelleci
mehmet kelleci il 1 Apr 2020
Hello Dear People,
I have been working on a gui on appdesigner that receives data from a TCIP instrument and displays it in real time. For example, I receive a data in every 50ms, I am going to receive 100 pieces of information in 5 seconds this make(hello yoda). This calculation holds in my code if i wait until the end of receiving then plot. If i plot the data the moment I receive it, this calculation does not hold and time extensifies by three times.
So, I can write codes that handle my needs of engineering, however optimization&efficient coding, I have lots of stuff to learn. You can see the related part of the code below. Can you help with speeding up this piece? I am waiting for your precious comments dear comrades :)
Graf = animatedline(app.UIAxes);
tic;
for i = 1:app.TerminationFrequencyEditField.Value
fprintf(SG382,strcat(parameter,num2str(WrittenFrequency),unit));
Time(Index) = toc;
addpoints(Graf,Time,Frequency);
drawnow;
WrittenFrequency = WrittenFrequency + 1;
Frequency(Index) = WrittenFrequency;
java.lang.Thread.sleep(app.MilisecondstoWaitEditField.Value);
end
%% Terminate the connection.
fclose(SG382);

Risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by