12-08-2008 04:15 PM
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
12-09-2008 07:49 AM - edited 12-09-2008 07:49 AM
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.
12-09-2008 11:32 PM
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
12-10-2008 12:33 AM
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
12-10-2008 10:54 AM
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.
12-10-2008 12:45 PM
Hi Hillman,
I am using a camera connected to a laptop by USB (IMAQ USB) and a linescan camera connectedto laptop buy PCMCIA card.
12-11-2008 12:50 PM
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?