LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to change the transmission rate of data flow in producer/ consumer pattern

Hi All
I am new to labview and trying to design a application to transfer image data in different rates, that means I can change the transfer rate in the transmission process. In fact,I refer to the the Queue Basic.vi to achieve this function by Changing the delay value of dequeue and enqueue.The program is divided into three parts:

The first part is the sender in vc used to split and send image data.Data size is 226kb and each time we send a 1kb packet;
The second is labview rate-change part,use producer/ consumer pattern and queue to transfer data;
The third one is the receiver in vc,receive data in sequence and synthetic images.

The entire transfer process is: image data was sent from the sender to producer loop through DLL, then enqueue--dequeue in consumer loop--DLL--receiver.The sleep time in vc sender is equal to the delay value in producer loop and this makes it look like the data generated as in the loop.

Now this is where my dilemma is:
When transferring data, if the producer loop and consumer loop delay value are equal(both 20ms), I can see image synthesis at a constant speed and no data lose; if I change the consumer loop delay value and make it greater than the producer delay(one is still 20ms and another is 50ms),that means receive in a lower rate and store data in queue. I can see Elements in Queue
increase but the image data randomly lost, and the image synthesis speed is not reduced.
My question is why image data loss and I can't see the image synthesis speed reduced when change the delay value in consumer loop?

Do anyone know how to solve the problem? Are there any examples I can refer to? Any suggestions are greatly appreciated!

0 Kudos
Message 1 of 1
(2,110 Views)