Terry,
Your biggest problem is that you are using the loop index to select which frame to display. The vision acquisition is going to run much faster than the AVI creation, so you won't be able to keep up with it. Whenever the acquisition laps the AVI creation, you will get a jump in the image. If instead you use Status to get the last valid frame, you can always be displaying the current image.
There are a couple of solutions. If you are doing short enough loops that you can keep them all the images in memory at the same time, you can just set up a large buffer and stop acquisition after the desired time, then write the buffers to the AVI at your leisure.
If you need to store images over a long period of time, you are going to end up losing images.
In this case, you should use Status to find out what the last valid frame is, and write it to the AVI. You probably will want to figure out how long the AVI takes, and select images that are equally spaced. You could use the skipcount when setting up the buffer so that the acquisition becomes slower than the AVI.
Bruce
Bruce Ammons
Ammons Engineering