Author Topic: Increasing speed of DataSubscription  (Read 1994 times)

aquilmustafa

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Increasing speed of DataSubscription
« on: November 17, 2020, 07:42:13 AM »
Hi,

I've designed communication protocol for modified Modbus-RTU protocol designed by local programmer in STM-32 micro-controller. I've tried designing protocol with SUBSCRIPTIONS as in AHMI. Problem is my system gets slower as the no. of components increases. Can anyone suggest a better alternative then the timers which will not hang my system and make it fast just like original AHMI.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Increasing speed of DataSubscription
« Reply #1 on: November 17, 2020, 08:13:03 AM »
The AdvancedHMI drivers are quite complex with multiple threads and subscription optimizing. This is all necessary to keep from slowing down the UI thread. Winforms uses a thread just for the UI. The more you put on that thread, the more it slows down the response. The driver must do all of its processing on a separate thread, then synchronize to the UI thread when it is necessary to update any data on a form.

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Increasing speed of DataSubscription
« Reply #2 on: November 18, 2020, 11:23:53 AM »
Yeah Agree with Archie, it's a bit more complex than that. 

Although depending on which version of the STM-32 microcontroller you're using, they can support multi-threading. Look for your chip version and the phrase RTOS (real time operating system) and you should find some examples of how to do this. Its not simple, but here is one example. https://www.digikey.com/en/maker/projects/getting-started-with-stm32-introduction-to-freertos/ad275395687e4d85935351e16ec575b1

You can instead create a simulated Multi-threading application where you chunk up your processor into a series of Tasks which have allocated time slices. Again not simple but does offer some level of multi-threading.
Still just trying to figure out this thing called Life.

MajorFault

  • Guest
Re: Increasing speed of DataSubscription
« Reply #3 on: November 18, 2020, 02:35:24 PM »
Can anyone suggest a better alternative then the timers which will not hang my system and make it fast just like original AHMI.

You mentioning timers got my attention.  What's the purpose of timers?