01-08-2014 04:21 PM - edited 01-08-2014 04:41 PM
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
Solved! Go to Solution.
01-09-2014 06:49 PM
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
01-10-2014 09:54 AM
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
01-13-2014 11:03 AM
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
01-15-2014 01:57 PM
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