LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

acquire 2 signals simutaneously

Hello everyone,

I am developing a system to acquire 2 types of signal simutaneously but at different rate, one is a video signal at 30FPS and the other signal is at 10kHz.  How should I save the video data so that it does not matter to the rate of the other signal?

Thank you very much for your suggestion,

Hannah

0 Kudos
Message 1 of 7
(3,388 Views)

Hi Hannah,

 

Thanks for your post and I hope your well today.

 

I would use the producer/consumer design pattern. In the producer loop, I would do your simutaneously DAQ (which can be at different rates). Then I would enqueue data to a second loop to do the save to file. This means the top loop (producer) can acquire data at any given rate without interruption. 

 

For an example of this please see NI Example Finder - Help>>Find Examples, SearchTab - Queue Basics. (See Screen below).


Notice that the top left and bottom left loops can operate at different time. Also notice that the bottom loop only iterates when an item is present in the queue. This would be the data you would dequeue and save to file. 

 

There is no reason why you can't have multiple consumer loops to do processing for other tasks (the non video). 

 

Please let me know what you think,

Hope this helps. 

Message Edited by Hillman on 12-09-2008 01:49 PM
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 7
(3,368 Views)

Hi Hillman,

Thank you so much for your suggestion.

However, I do want the two acquisition synchronized, start and stop at the same time. I will use synchronizing timed loops.

Thanks again for your help.

Hannah

0 Kudos
Message 3 of 7
(3,343 Views)

Hi Hillman,

I found out that using timed loop is impossible since our signal acquisition rate is 10kHz while the timed loop just has 1kHz resolution.

So do you know how I can synchronize the loops in queue exam?

Thanks,

Hannah

0 Kudos
Message 4 of 7
(3,332 Views)

Hi Hannah,

 

Thanks for your reply and I hope your well today.

 

Synchronization is fairly straight forward to implement. I would recommend firstly, looking at an example in DAQmx (however, what drivers are you tasks using?). In the NI Exampel Finder (Help>Find Examples..) and then Hardware Input/Output>>DAQmx>> Synchonization>>Multi-Device>>Multi-Device Synch-Analog Input_count Acuisition.vi.

 

For other devices (not within the same family) can be a bit harder.. it really depends on the hardware your using. You may have to share a clock source between the tasks for example.

 

If you could provide more details on the tasks (drivers) your using I should be able to help some more.

 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 5 of 7
(3,318 Views)

Hi Hillman,

I am using a camera connected to a laptop by USB (IMAQ USB) and a linescan camera connectedto laptop buy PCMCIA card.

 

0 Kudos
Message 6 of 7
(3,307 Views)

hannah,

 

It sounds like you have two camera acquistions running at two separate rates, and that you also want to save each set of images to file, but you don't the file write time to affect your acquisition time. You can still implement the producer consumer architecture to do this but you need to be careful on how you do it as the Image data type is a pointer to the buffer but not the actual image itself. Please read the following KnowledgeBase for further information: Can I Use Queue VIs in LabVIEW with IMAQ Images?

 

Here's is an example of how you would implement the producer/consumer architecture with the Image data type.  NI-Vision Image Processing with Producer/Consumer Loops

This example is using IMAQdx VIs, simply replce these with the appropriate IMAQ USB VIs. Also, in the consumer loop, replace the Inverse function with the proper VIs to write the image to file.

Does this make sense?

--Michelle

National Instruments
0 Kudos
Message 7 of 7
(3,286 Views)