LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Move window trouble with producer/consumer loops

Hi, there are many topics about producer/consumer but it seems I'm the only one having a crash problem when moving my application window.

 

I built a huge recording application using cDAQ rack and DAQmx library in a producer/consumer loops architecture. Everything works perfectly but when I'm recording (using consumer loop), I got random occasional crash for the past 2 years. I figured out where it comes from today. If I click and hold the top bar for 2-3 seconds to move the window, I can cause a crash each time. In my application, I also have a third loop (besides producer and consumer) that has a structure event. I disabled built-in move window ability and created a custom event button with some "Call Library Function" blocks to replicate the move window ability and get the same result.

 

For now, my solution would be to disable move window ability while I'm recording but that's some sort of patch. Is there an alternate way to give entire priority to consumer loop or something like that to avoid crashing and still be able to move the application window.

 

Thanks!

0 Kudos
Message 1 of 3
(163 Views)

Interesting... I don't have an answer but I remember reading long ago about preventing VI's from switching to the User Interface (UI) thread for speed since there is only on UI thread. I am guessing that your Consumer Loop is probably also displaying data as well as saving data. When you move the window it might be causing the UI thread to lag and overflows your queue or some other memory buffer.

========================
=== Engineer Ambiguously ===
========================
Message 2 of 3
(135 Views)

@RTSLVU wrote:

Interesting... I don't have an answer but I remember reading long ago about preventing VI's from switching to the User Interface (UI) thread for speed since there is only on UI thread. I am guessing that your Consumer Loop is probably also displaying data as well as saving data. When you move the window it might be causing the UI thread to lag and overflows your queue or some other memory buffer.


A property node in your consumer loop would do it also. Since you are using DAQmx, this is not likely, but if you have a DLL in your consumer loop, it may be set to run in the UI loop. (Don't switch it unless you know it is thread safe.)

0 Kudos
Message 3 of 3
(91 Views)