PXR Family

Datasheet (PDF)

Manual & Guide

Application Notes

Driver Updates

Example Source Code

Compatible Image Processing Software

Product FAQ

All Frame Grabbers

Home Page


Feedback at:
CSinfo@cyberoptics.com or
1-800-366-9131

PXR_GRAB_RT1 - Realtime Display Sample 1

Win32 Systems (Win98, Me, NT, 2000 and XP)

This sample shows you how to grab and display frames in realtime. The PXR800 provides two ways of doing realtime display:
1. Double buffering in software, or
2. Double buffering in hardware..

This sample illustrates method 1. If you are interested in method 2 see PXR_GRAB_RT2.

Method 1:
We allocate two grab buffers and we alternate grabs to them. While one buffer is being filled with video, the other one can be copied to the VGA card for display. We use the IW_QUEUED flag with each grab in order to let the grab work in the background while our program is still running and copying buffers.

In order to implement this method, we need to set the PXR800 to single buffering. The default is double buffering. We use the following command:
PXR.SetContinuousBuffering (hFG,BU_SINGLE);

This method works quite well and will result in a realtime display if a buffer can be copied to the VGA faster than the next grab can take place, which is either 33 or 40 ms depending camera type. Almost any system today can achieve a realtime display by using this method.

The only drawback to this method is that it does require handling two buffers in software.

In this sample you will learn how to do the following:

1. Create a simple control window.
2. Create a video display window.
3. Initialize the PXR frame grabber.
4. Grab individual frames and display them in the video display window.
5. Grab frames and display them in realtime in the video display window.

In the PXR frame grabber samples, we have decided to use two windows (one for control and one for video display). We do this throughout the samples. We feel that two windows gives you more flexibility in designing controls although it does add some complexity.

This program uses two external modules that will be common to all of our samples for the PXR Series frame grabbers.
1. PXR_DISPLAY.C -- video display common code
2. PXR_FILERW.C -- file read/write common code