56 views
in GUI Development by

Hello everyone,

I'm currently working on graphical implementations using Embedded Wizard, and I've encountered an issue related to data loss when updating a graph at high speeds. Here's the situation:

Project Details:

  • Graph Update Interval: 5ms (from UART)
  • Data Reception Interval: 2ms
  • Data Source: UART communication
  • Microcontroller: STM32MP157F_DK2

Problem: I'm receiving data every 2ms via UART and need to update the graph on the GUI every 5ms. However, I'm experiencing data loss when updating the graph. I have confirmed that the data is correctly received by the microcontroller, but the issue seems to arise during the data update to the GUI.

Steps Taken:

  1. Verified that UART data is received correctly by the microcontroller.
  2. Tried different update strategies but still facing the same issue.

Questions:

  1. What could be causing the data loss during the GUI update?
  2. How can I ensure that all the data is accurately represented on the graph without loss?
  3. Are there any best practices for handling high-speed data updates in Embedded Wizard?

Any advice or suggestions would be greatly appreciated!

Thanks in advance!

1 Answer

0 votes
by
Hello,

I think the key is, that you consider the graph update (the GUI) is not drawn in real time!

This means, your data come in every 2 ms and you trigger an update. The update of the GUI might happen immediately or it might happen some milliseconds later. Thus, you have to collect (queue) your data and once the GUI update happens, you draw all data that are recorded since the last update.

As a result, you can update every second or 10 times per second or 50 times per second, the graph on the screen shows always the same number of data per second.

Does this help?

Please have a look into the PatientMonitor demo - it demonstrates these aspects.

Best regards,

Manfred.
by
Thank you for your guidance.

However, if this were a medical product, we would need to display the output data immediately or continuously. Could you please advise on the best approach to achieve this?
by
I have followed steps as per in that patient monitor example sir
by
Of course, the data should be displayed immediately and it is the goal to minimize the delay. What I tried to explain: Your software should consider a timespan between the data reception and the display update. If the received data is buffered, a timespan between data reception and display update will not cause any data loss. Even though it is the goal to present the data immediately, the software should be able to handle a delay (a few milliseconds or more) of the display update.

Are you using EwInvoke() or EwInvokeCopy() to provide the data from the UART communication thread to the GUI thread?

Embedded Wizard Website | Privacy Policy | Imprint

...