From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

High Speed Continuos Acquisition and Lock-in Détection- Producer/Consumer

Solved!
Go to solution

I have implemented a simple producer consumer to acquire data at 4 MSPS (2 channel) using PCI 6110E and use NI-Lock-in detection. I always end up labview crashing due tomemory error. The queue size keeps increasing. 

 

I am quite surprized that even if I disable the Lock-in detection and do asimple logging, the system crashes. However, if I have the lock-in detection done in the producer loop, it works perfectly.

 

I modified the code to use consumer loop to write to csv files the 2 channel data.Again, the queue size keeps increasing. The second image demonstrates the issue. What I see is that producer/consumer cannot run at higher sampling rate very well. Please correct me if I am wrong. 

 

Also, could you please suggest a solution to the problem?

 

Thanks

RY
Download All
0 Kudos
Message 1 of 5
(2,984 Views)

Hi RY,

 

Looking at the examples you've attached, it looks like the error you are seeing occurs when you are putting a large amount of processing in the producer loop. This will add to the increasing queue sizes you are seeing. Is there any way you can put the fewest amount of processing in the producer loop when you are trying to save your file? Producer/ consumer loops are designed to handle this type of sampling rate if most of the processing occurs in the consumer loop.

 

I hope this helps.

 

Anna L

Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,895 Views)

Hi Anna,

 

In my first implementation, I made acquisition in the producer loop and processing in the coinsumer loop. Queue size kept increasing. However, when I moved the lock-in detection in the Producer loop, I never faced the problem of labview crashing due to memory.

 

In second implementation, I used the working mode (acquisition and lock-in in the producer loop) and initiated TDMS logging, and it worked. My question remains as to why when I move lock-in detection in the consumer loop the labview crashes.

 

Please suggest me a solution.

 

Thanks

RY
0 Kudos
Message 3 of 5
(2,854 Views)

Hi Ry,

 

What version of DAQmx are you using? I am not as familiar with lock-in detection- can you attach your VI so I can examine your code a little more thoroughly so I can provide a better explanation?

 

Thanks!

Anna L

Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(2,742 Views)
Solution
Accepted by topic author VEEDAY

I have fixed the issue. I am saving to TDMS instead of XLSS and using the lock-in in the Producer loop which works without any issue. Thanks

RY
0 Kudos
Message 5 of 5
(2,665 Views)