Effacer les filtres
Effacer les filtres

Realtime data from motor controller

3 vues (au cours des 30 derniers jours)
Chris
Chris le 28 Déc 2020
Commenté : Mario Malic le 21 Jan 2021
Hello,
I have a question how to plot and show real-time data in App designer, maybe someone can help me, I am beginner in Matlab.
I get my data (e.g. Velocity) easy with webread() in hex and just have to convert into a decimal number, it already works.
But now I don’t know how to write an easy and efficiency program to get actually data e.g. velocity, motor current, torque to show them into two ways in App Designer:
  1. In an EditField to see the Data like a Display
  2. In a plot to see data in a graphic and safe
Thanks a lot for any advice to find a good solution :)

Réponse acceptée

Mario Malic
Mario Malic le 31 Déc 2020
Hey Christian,
It would be the best if you'd do few introductory examples in App Designer and you'll get an idea how to do your task.
% 1. Set the property value of the Edit Field component this way
app.EditField.Value = 5
% 2. Once you create axes in your app, use plot function
plot(ax, x, y); % ax is the handle to your axes, example app.UIAxes
  21 commentaires
Chris
Chris le 21 Jan 2021
Hello Mario,
super! Thanks for create a demo app. Everything is working well.
"Another thought: when velocity is zero, signal you get might not be zero, but very low, let's say 1E-3. On plot it will look like it's jumping around, which it actually is but such small number can be neglected."
Exactly, that was the key I had in the beginning really high measurement errors sometimes (1E+9): Now I limited the range in the beginning and the plot is working well.
Mario Malic
Mario Malic le 21 Jan 2021
Great to hear, you're welcome.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by