02-05-2013 10:58 AM - edited 02-05-2013 10:59 AM
Today I found a problem (Maybe not a problem really):
When I click on a running VI to move the window, it seems being stopped for a moment (say, less than 1 second).
Please try the attached simplest while loop VI. You will see the value pauses for a moment when you left click and hold on the windows title bar.
I just don't understand.
Solved! Go to Solution.
02-05-2013 11:14 AM
You a correct.
You need to left click and hold the left click without moving. As soon as you move it continues.
I had never seen that before. I will try an experiment.
02-05-2013 11:24 AM
I did an experiment to see if data continued to be sampled while the display paused. The results I got showed that the timestamp did not vary by more than 11ms, which meant that although the display is not refreshed initially while holding down the left mouse button, the data was still populated into an array.
I took an array of ticks and checked the time difference between each iteration. They were as follows (in ms):
10, 10, 10, 10, 11, 10, etc...
The .2 ms accounts for the time to process the code in the loop.
02-05-2013 11:51 AM
That will be OK if just the display pauses on the front panel while the program is still running continuously .
02-05-2013 01:39 PM
This is expected, windows is not deterministic and you are in the UI thread, same thread as repainting and moving the window.
If your loop is so time critical you can explore timed loops or move to a RT systems.
02-05-2013 02:05 PM
falkpl is correct. The UI thread can be a tricky thing on any operating system. I've seen this myself on Windows where the UI "freezes" but the code is continuing to run. Unfortunately there is not much that can be done and is a fate that all applications suffer on general purpose operating systems. Some simple steps that might help is to make sure that there aren't any other programs running that is hogging the UI thread (just close out of everything) but even then you can experience the UI update stutter.
02-05-2013 07:49 PM
Thanks to Ray.R, falkpl and G-Money for explanations.