Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple serial data stream inputs

Solved!
Go to solution

Lynn,

 

I added a while loop that keeps flushing the Queues in the Dequeue loop that I believe is continually flushing the data out until the loop times out and allows the next data to be written to the spreadsheet.  The queue size monitor appears to be controlling in the range of between 0 and 10 samples.  I would appreciate it if you could take a look and let me know if I am on the right track.

 

Phil

 

vi attached

0 Kudos
Message 11 of 15
(1,273 Views)

Phil,

 

Your inner loop only runs once for each iteration of the outer loop. Most likely the flush occurs immediately after the loop starts running. Then after the Wait, the loop stops and the Dequeues start.  If any of the enqueue loop has run more than once during the wait, you will have multiple elements in the queues and will only read the oldest ones.  This explains why you see up to 10 on the queue size monitor.

 

If you move the flush queues after the Wait, then you will get the next data in the queues.  However, you will need to wait until new data is put into each of the queues after the flushes, so you may need to adjust the wait times.

 

Lynn

 

Fluh Queues after.png

Message 12 of 15
(1,272 Views)
Solution
Accepted by topic author larosts

Lynn,

 

Looks lie it is working.

 

On to some more rigorous testing.

 

 

Phil

0 Kudos
Message 13 of 15
(1,268 Views)

Lynn,

 

Application working great so far.  A lot of cleaning up to do but the basic system is working just fine.

 

An remote pint to you for all of your help.

 

Thanks so much,

Phil

0 Kudos
Message 14 of 15
(1,252 Views)

Phil,

 

Glad you got it working.

 

Lynn

0 Kudos
Message 15 of 15
(1,248 Views)