LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic Producer/Consumer loops for a newbie

Labview neewbie here.
I was looking at Producer Consumer loops.
Can anybody give me a very basic explanation of how to set one up.
I want to take readings from a HP 53131A counter and store them in an excel spreadsheet.
I understand the part about labview slowing down as it opens the Excel file, and a seperate loop will help solve this.
But I dont understad how to set up the Que function.
 
Thanks.
0 Kudos
Message 1 of 3
(2,700 Views)

Multithreading will not make excell open faster but using concurrency you can have more than one operation operate ate different speeds.  The nice thing about the produce consumer model is that the if the consumer is slow or unreliable (freeses up) the producer doesnt care and will continue.  To use a queue is very simple, 1. create the queue, name it(optional) and give it a data type (ie int, array of floats ...)  in the produce loop use the enqueue vi to add items as needed to the queue, in the consumer dequeue these items (using a timeout = -1 the loop will wait for a new item and not consume resources)  the consumer can process the data acquired in the producer loop.

 

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