LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queues in parallel While loop not executing

Hi all,

 

I've come across a curious problem. So I have a test bench which collects measurements, puts it into a queue to be saved into local txt files. A second queue saves the same data into an SQL databank.

The reason for two separate queues was that writing into the SQL databank had a slight delay, and would sometimes freeze the program. With the queues the data could still be written locally if the SQL databank went offline for some reason or so and the program could still run.

 

Recently I noticed that the data was not being written into the SQL Databank even though the locally saved files contained all the data.  The program has two modes, let's call them Mode 1 and 2, which are separate VIs called into the subpanel of the main VI (only one at a time). Both Mode 1 and 2 have this same structure of data saving. Only Mode 1 has this problem while Mode 2 does not. All the queues in both Mode 1 and 2 are named with different names so that there's no identical name for a queue in different subVis. 

 

What is even more curious, is that several PCs use the same .exe and yet the behavior was only present on some PCs. On my development PC, the problem did not occur when I used the .exe but did when I was in the enviromental mode.  At first I suspected a race condition which might have caused this behavior. However after placing probes on the error and queue wires. I noticed that the some of the while loops were not even being executed (see labels in sample code) after working on an initial run. I find that strange because the while loops should have at least started before throwing an error (if one occured). It's even weirder that I still manage to exit all the loops. After rebuilding the exe, it worked for a while and then the problem started again. If it's a memory leak I feel it should have also crashed when Mode 2 is used (which doesn't seem to happen)

 

Unfortunately the VI is far too large and complex, so I'm attaching a simplified version (LV2023 and LV2018) for how it saves data. When running it an Error 1 GPIB occurs, which doesn't happen in the real program, so I don't know where that came from...

 

Thank you in advance.

Download All
0 Kudos
Message 1 of 1
(64 Views)