10-19-2006 04:15 PM
10-20-2006 01:50 PM
Mike,
The big question is how long the TTL pulse lasts. If it stays on long enough to poll it several times a second, you shouldn't have any problems.
I would try the following:
Create an image buffer that will hold 5 minutes of images at one per second. This will be circular buffer, and you will have to manage the indexing. You will either have to increment the index (with wrapping) every time you copy an image, or you can rotate the array of images every time.
Acquire the images in a continuous buffered loop that will hold a few seconds. Several times a second, poll your trigger and check the acquisition buffer status. If the trigger is on, start a counter to acquire 4 more minutes of images. If a new image is ready, copy it to the circular buffer. You only want to copy images with an index that is a multiple of your frame rate.
This may sound fairly complicated, but it isn't that bad. It is just a while loop with a couple of cases in it.
If your trigger pulse is very brief, you will need to find a way to register the pulse.
Bruce
10-21-2006 09:30 AM
@mjd wrote:
I am collecting a series of time lapse images (1 image per sec) that is triggered by a TTL pulse. This is possible using IMAQ List/Copy routines using a single buffer and repeated calls to Copy every ~1 sec to retrieve each image ; the images are then saved to an AVI file. I'm sure there are better ways to do this but this works.
For the timing, which only needs to be approximate, I sample the A-D board 72,000 times (takes about 1 sec) check if the DiG 0 line has gone high and if so, start image collection for 5 min, once every sec.
The problem is that I would like to have access to about 60 of the "pre-triggered" images, i.e. 1 minute of image data BEFORE the trigger TTL pulse. The routine will run for 5-6 hours before the trigger fires and then images will be collected for about 5 min. So, I'd like to collect the image data from min -1 to min 4. I have followed the various threads partially related to this and followed the advice in them (mostly from Bruce) to use the high-level SEQUENCE vi as a template.
The problem with this, is if I put 60 images into the HL sequence vi, I can only sample for the TTL pulse once every MINUTE. I need to sample it once every SECOND. If I deconstruct the HL sequence vi I can find no place in it to sample my A-D board every second.
Does anyone have a solution?
Mike
10-21-2006 12:47 PM
I wrote a quick example of the image acquisition part. While writing it, I remembered you can use the Skip Count to skip frames. By setting the Skip Count to 29, you will get every 30th frame, which should be once per second. This simplified my idea and eliminated the second buffer. If you are using firewire, you will need the more complex solution since I don't think firewire has the Skip Count available.
This example loops every 200 msec, so you should be able to check your trigger every time through the loop and respond accordingly.
This example has not been tested at all, so don't be surprised if there is a bug or two.
Bruce
10-21-2006 01:31 PM
10-30-2006 11:38 AM
10-30-2006 03:10 PM
I put a piece at the end that reorders the image array so that the oldest image is first, and the newest image is last. It may need a little work, but it should be really close to the correct order.
Bruce
10-30-2006 04:23 PM