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.

DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Large data transfer between modules

Solved!
Go to solution

I am new to DQMH, but was thinking of using DQMH for a project in which I collect and store video. I'm not using IMAQdx. Each frame is 300k bytes.

 

Would it be acceptable to use DQMH request events to transfer frames between a module that collects the images and another that stores them to disk and another that analyzes them in real time? Or would that be too inefficient? 

 

Thanks, 

 

David

 

0 Kudos
Message 1 of 15
(4,541 Views)
Solution
Accepted by FabiolaDelaCueva

If you were worried, you could just send a DVR.

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
Message 2 of 15
(4,513 Views)

Of course! Thanks.

0 Kudos
Message 3 of 15
(4,505 Views)

IMAQ image is a special beast in LabVIEW, it's a by ref data type so I don't think you need to use DVR.

Forking an image wire doesn't duplicate the image data.

If you have time, take a look at this thread on Lava.org : https://lavag.org/topic/21212-imaqimage-references/Imaq where this is being discussed.

 

Also, do you really need to transfer your image from one DQMH module to another one?

You might, if one is doing the acquisition and another one is doing processing but if it's only acquire and save as video, one module with 1 or 2 helper loops might be enough.

 

Also, one general piece of advice I would give about buffer management for IMAQ images is to pre-allocate 2 separate sets of buffers for acquisition and for images to be saved. And a 3rd one for processing if so needed.

 


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 4 of 15
(4,468 Views)

Do you know how long it takes to copy your 300kb images (which aren't imaq, I understand)?  Only if this is too large then go with a DVR.  By-reference is more complicated to do right.  By-value is simpler, if you can afford the copies.  300kb sounds quite small to me; I would expect saving those images to be your rate-limiting step, not copying.

Message 5 of 15
(4,433 Views)

Not IMAQdx. I read from the camera directly through its DLL. I can collect, analyze and store 120 images per second currently on 4 cameras.  

 

I have not tried to time how long it takes to copy an image from one place to another. Probably much less than 1 ms. But at the frame rates I am going, every bit helps. 

 

One vi with two loops is how I have been doing it for a long time. One to collect/analyze/display, another to store. But the architecture is very ad hoc. I thought with something more formal like DQMH, I would make the code more modular and maintainable. Maybe that's overkill. 

Message 6 of 15
(4,415 Views)

"Every bit helps" is also known as "premature optimization".  

0 Kudos
Message 7 of 15
(4,401 Views)

Normally, I'd agree. There are hundreds of systems out there working nicely. If it ain't broke... But in this case, I am working on adding some significantly more complex analyses, and increasing the size of the images. So while I am reorganizing, I thought to take the opportunity to improve, update, modernize, streamline some pretty old code that was written when I knew less about LabVIEW. 

Message 8 of 15
(4,396 Views)

Hi FlatCat,

 

Keep us posted with your progress and if you run into any issues. At Delacor we are working with a customer that is acquiring images at a very high rate and NOT USING IMAQ. We are using DQMH successfully. We are using DVRs to pass the large data arrays between the acquisition module and the display module.

We are acquiring at 2 Gigsamples per second! 

One thing that we realized is that you want to separate your acquisition from the display, this ensures all your acquisition and analysis never goes to the UI thread. In this particular case, we are using intensity graphs to display the images, so we created a DQMH module for the Intensity Graph that has a request to Display Data and the Acq/Analysis module calls that request. 

 

Eventually, the acquisition and analysis will be done in LabVIEW FPGA, at that point, we can keep the display module as is and we will just replace the current DQMH ACQ module with the DQMH FPGA module.

Good luck!

Fab

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 9 of 15
(4,388 Views)

Wow. I wish I could sneak a peak at your code. 🙂

 

As I said above, right now I have a big Main that has separate loops for acquisition/analysis/display, and then user interface. I will separate them. 

0 Kudos
Message 10 of 15
(4,366 Views)