LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

program stopped for a moment when click on the windows title bar

Solved!
Go to solution

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.

0 Kudos
Message 1 of 7
(2,769 Views)

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.

0 Kudos
Message 2 of 7
(2,762 Views)
Solution
Accepted by weitong

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.

0 Kudos
Message 3 of 7
(2,759 Views)

That will be OK if just the display pauses on the front panel while the program is still running continuously . 

0 Kudos
Message 4 of 7
(2,753 Views)

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.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 7
(2,735 Views)

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.

0 Kudos
Message 6 of 7
(2,723 Views)

Thanks to Ray.R, falkpl and  G-Money for explanations.

0 Kudos
Message 7 of 7
(2,694 Views)