13.07.2015 Views

CompuScope SDK Manua.. - Egmont Instruments

CompuScope SDK Manua.. - Egmont Instruments

CompuScope SDK Manua.. - Egmont Instruments

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ticks = GetTickCount();while (gage_busy ()){if (GetTickCount() > ticks + BUSY_TIMEOUT) {gage_abort_capture (board.source);return (0);}}Transferring the <strong>CompuScope</strong> DataThe acquired <strong>CompuScope</strong> data can be transferred when the board is no longer busy, and the gage_busyroutine returns a 0. First, the location of the sampled data within on-board <strong>CompuScope</strong> memory isdetermined with a call to the gage_calculate_addresses routine. This routine returns the start address, thetrigger address and the end address that are required to determine the location of data that was capturedinto <strong>CompuScope</strong> memory.<strong>CompuScope</strong> memory is organized as a circular buffer, so that direct numerical comparisons of theaddresses should be avoided. For instance, because the memory counter rolls over when the acquisitionreaches the end of on-board memory, the end address may actually have a lower numerical value than thestart address. Naively subtracting the start address from the end address in order to determine thecapture length would therefore incorrectly yield a negative number. The gage_normalize_address routine,which accounts for memory roll-over, can be used for such comparisons.Before data transfer, the <strong>CompuScope</strong> must be prepared for data transfer using the gage_need_ramroutine. Generally, the application should call gage_need_ram(1) before transferring data and shouldcall gage_need_ram(0) after data transfer is complete.The recommended method of retrieving data from <strong>CompuScope</strong> on-board acquisition memory is thegage_transfer_buffer_3 routine. This routine transfers data using PCI bus-mastering of large data blocks,if supported by the <strong>CompuScope</strong> hardware. PCI bus-mastering is the fastest method of transferring dataacross the PCI bus. It requires no CPU arbitration and bus-mastering transfer rates can be sustained at upto 100 Mega Bytes per second. Gage_transfer_buffer_3 also automatically interleaves data from bothADC memory bank when operating <strong>CompuScope</strong> hardware in single channel mode.Other <strong>CompuScope</strong> data transfer methods are described in the <strong>CompuScope</strong> API Reference <strong>Manua</strong>l forolder Gage users. These routines are not recommended, however, for new designs.Page 36<strong>CompuScope</strong> <strong>SDK</strong> <strong>Manua</strong>l

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!