01-31-2019 09:20 AM
Hi, I have a frame grabber PCI card in my PC that is receiving streaming data from an autonomous source. The card came with its own driver/library and sends an interrupt after 32KB of data has transferred (can't make that buffer bigger). When I process that data and display it via the PlotIntensity() function, I sometimes miss/lose data most likely due to the time taken to plot. I tried running the data processing in a separate thread - asychronous timer, but it appears that the ProcessSystemEvents() has no effect in a secondary thread, so the PlotIntensity doesn't happen and no display. Is there a way to set this up so that the frame grabber interrupts happen in a secondary thread? Or is there a way to get PlotIntensity to work in the secondary thread?
Thanks, Mike
Solved! Go to Solution.
02-04-2019
12:53 PM
- last edited on
04-26-2025
05:14 PM
by
Content Cleaner
Hi Mike,
Have you considered setting up thread safe queues to store and read the data? You should be able to store all of your data in one thread and read from another thread without missing any data this way. I've provided a link below to help page on them that has more info:
Using Thread Safe Queues to Protect Data
02-05-2019 08:41 AM
Thanks! I will give it a try. Do you know if there is a size limit to Thread Safe Arrays? Mine will be over 150KB.
02-05-2019
09:40 AM
- last edited on
04-26-2025
05:14 PM
by
Content Cleaner
I can't find documentation on it but I would assume it would be the largest block of contiguous memory that LabWindows/CVI could allocate, which I would guess would be more than 150kB. Here's a help page that may be applicable to allocating more memory for a specific thread, although it may only apply to the Real Time Module.
Creating an Appropriate Memory Buffer