Realtime data from motor controller

3 views (last 30 days)
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 :)

Accepted Answer

Mario Malic
Mario Malic on 31 Dec 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 Comments
Chris
Chris on 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 on 21 Jan 2021
Great to hear, you're welcome.

Sign in to comment.

More 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!