01-26-2006 11:10 AM
01-27-2006 03:36 PM
Hi PhilL,
1. I would suggest using an AVI to save your sequential frames. This will reduce the amount of time your function spends opening and closing files because you can keep an AVI open and append to the file.
2. I have come across two methods for synchronizing a DAQmx and IMAQ board. One method uses the DAQmx board to trigger the IMAQ capture using a RTSI cable. You can set your DAQmx trigger frequency to 30Hz for your desired frame rate. An example file has been included with this post.
The second method uses the external trigger on the camera to trigger the DAQmx acquisition. A discussion on the synchronization of the two can be found here. You just need to use the IMAQ Trigger Drive2 vi being driven by the Vertical Syncronization signal of the IMAQ. Then connect that signal through BNC, neglecting the grounding line, to a DAQmx PFI line. I believe that both boards use the same ground since they are connected in your computer.
3. Hopefully this advice helps you synchronize the two acquisitions. If this is the case, I would definately recommend saving a timestamp with the voltage measurements as you suggested.
Let me know if this works or you have further questions.
Regards,
Ryan
01-31-2006 09:29 AM
Hello Ryan,
first of all, thaks a lot for your help. After examining everything, I had also decided to use the sequence to save to avi.
As for the synchronization, I have to admit I'm still having problems. First of all, I checked my board and there isn't a RTSI socket, so I can eliminate that possibility. This means I need to use the BNC trigger (I/O) on the 1411 and a PF line on the 6221 (alos I/O) and to be honest, I don't really know how... I know how to change the trigger input for the voltage measurements, but I don't know how to program the BNC trigger on the 1411 to output a trigger signal or to accept an incoming signal.
I saw the Trigger Drive2.vi, but don't know where to insert it into my "Sequence to avi" vi. I have included the two VIs I want to put together. If you could take a look at them and give me a few pointers, I would be really appreciate it. The first is where I acquire the voltage measurements. I suppose I have to insert the Sequenc to avi VI in the same While loop, but am not sure of which parts need to be included inside the loop.
What exactly is the 'Trigger Number' feild in the Trigger Drive 2.vi ? Could you give me an example?
As you can see, I'm a little lost. I think it would be simpler to output a trigger signal on one of the PFI lines and use it as a trigger source for the imaq board. When I create such a task in MAX, should I use an analog ouput, a digital output or a counter output?
Thanks again for your help.
01-31-2006 02:39 PM
Hey Phil,
I would still suggest using the IMAQ card to drive the DAQmx acquisition. It will be easier this way because you won't have to set up a periodic signal and drive the camera acquisitions. The card is automatically set up (through MAX) to acquire at 30 frames/sec. All that is required then is to use the video signal to drive the DAQmx acquisitions. Since you said you know how to change the DAQmx trigger, I will focus on explaining the Trigger Drive2 setup.
After looking at your application I would suggest inserting the Trigger Drive2 after the IMAQ Init and before your IMAQ Sequence. The triggers will not start until you begin acquisition (call IMAQ Sequence) and will stop when you are done with your sequence. As a result you should get exactly one trigger per frame with no extra measurements.
Set the Trigger Type to "External", the Trigger Number to "0", the Trigger Polarity to "High True", and the Trigger Drive to "Frame Start" or "Vertical Synchronization Signal". This will send a trigger out of the trigger port on the 1411 which you can wire to a PFI or trigger line on the 6221. This trigger signal will be true at the beginning of each acquisition and will allow you to match one voltage measurement to each frame.
I would suggest not skipping any frames during the IMAQ Sequence.
I hope this helps get you started. Let me know if you have any further questions.
Regards,
Ryan F.
02-01-2006 03:40 PM
02-01-2006 05:17 PM
Hey Phil,
Please refer to the Acq&Graph Voltage-Int Clk-HW Trig Restarts.vi example file. This file can be found in Help->Find Examples. Browse according to Task and follow Hardware Input and Output->DAQmx->Analog Measurements->Voltage. This setup provides one sample per incoming trigger and should work well for your application.
You will need to modify the example in the following ways:
DAQmx Timing needs: Sample Clock, Finite Samples, Samples > 1, and any rate you choose (try 1000). DAQmx Start Trigger should be set to Start Digital Edge. DAQmx Read should be set to Analog->Single Channel->Single Sample->DBL.
You can use the number of images in the sequence to end the DAQmx Read loop. Either append to a file each loop or enable indexing and save all your data out after the sequence is complete. You won't need a reference trigger.
04-18-2007 10:30 AM - edited 04-18-2007 10:30 AM
Message Edited by miethe on 04-18-2007 05:31 PM
04-18-2007 12:24 PM
04-19-2007 10:38 AM