beautypg.com

Sensoray 711 User Manual

Page 24

background image

Sensoray Model 711 Instruction Manual

25

image buffer are filled with data following one call to

X11_StartAcquire.

See BUFFER and X11_AllocBuffer.

acqmode

Acquisition mode switch. Can be one of the following:
Value Description
AMODE_SINGLE

Image buffer is filled once.

AMODE_CONT

Image buffer is filled continuously,

until the acquisition is stopped.

Returns
The function returns 0 in case of success, or an error code. It returns immediately after the
acquisition is started. The application determines if the acquisition is complete by polling
status bits, or through the use of interrupts. If continuous mode is selected, the first frame of
the image buffer starts being overwritten as soon as the last frame gets filled. The
application determines the completion of each individual frame by polling (and resetting) the
STATUS_READY bit, or through the use of the interrupts. If AMODE_SINGLE is selected,
the STATUS_READY_ALL bit is set upon the completion of the last frame of the image
buffer. If AMODE_CONT is selected, the STATUS_READY_ALL bit can not be polled
reliably, because it is being reset at the start of the first frame acquisition. There is no
interrupt associated with the STATUS_READY_ALL bit.

Example
PCI pci;
ECODE ecode;
MODE mode = {DEF_MODE_NTSC};
BUFFER buffer;
DWORD frames = THAT_MANY;
HFG hfg;
DWORD status;

if (!(ecode = X11_InitSystem (&pci))) {
/* assume we need the 1st frame grabber */
if (!(ecode = X11_GetHFG (&hfg, pci.PCIslot[0]))) {
if (!(ecode = X11_AllocBuffer
(&mode, &buffer, frames))) {
if (!(ecode = X11_StartAcquire
(hfg, buffer.hbuf, timeout, &status))) {
/* wait until acquisition complete */
while (!(ecode = X11_GetStatus (hfg, &status))
&&
!(status & STATUS_READY_ALL)) {
}
if (!ecode) {
/* application code here */
} else {
return ecode;
}
} else {
return ecode;
}
} else {
return ecode;
}