07-18-2019 10:53 AM
Hi altenbach,
Thank you for all your efforts helping me out.
I think that XY graph with a fixed array size in my application need much more work to sort it out. it is not as efficient in dequeue loop as it run in a regular loop. Just similar to the case as using a write-to-spreadsheet in dequeue loop is approximately 10 times slower than in a regular loop. The sample VI with random data generation is different from actual data acquisition that requires 10-20 ms. The performances can be quite different between the two even though both have the same program logical. I would like to use the dynamic growing array for the XY graph as it can run at an acceptable speed at this stage. I will add more data processing, e.g. filtering, to see how it eventually works. I might have to do further optimization when it reaches an unacceptable speed.
Best regards,
Gu
07-18-2019 11:12 AM
Hi edmonton,
you will get the most important performance boost when you don't update the graph/plots with each iteration of the consumer loop! It doesn't make sense to update a graph as fast as possible!
You still can update your arrays in the shift register, but you only need to update the graph each 100-1000ms…
07-18-2019 11:30 AM
The graphs already update asynchronously in the UI thread. If you don't believe it, right-click the graph and select "synchronous display" and the VI will take almost forever. 🙂
But yes, place the terminal in a case structure and update every 100-1000 samples and things will quiet down a little bit. (but maybe less than you think). Of course make sure to update on the last iteration. Still, as already mentioned, it is not reasonable to graph orders of magnitude more points than the available graph pixels, shoveling massive amounts of data for no real visual difference. Rendering the graph is expensive compared to the data shuffling on the diagram.
07-18-2019 03:04 PM
Hi GerdW,
Yes, you bet.
I used quotient & remainder function to extract frames for XY graph and added a control to adjust the frame rate, it runs as smooth as I want. See the attached update.
Thank you.
Gu