23.11.2014 Views

CompuScope SDK Manua.. - Egmont Instruments

CompuScope SDK Manua.. - Egmont Instruments

CompuScope SDK Manua.. - Egmont Instruments

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

gage_transfer_buffer_3<br />

Syntax<br />

C:<br />

uInt32 GAGEAPI gage_transfer_buffer_3 (int32 ta, int16 channel, void far *buffer, int32 nsamples);<br />

Visual BASIC:<br />

Function gage_transfer_buffer_3 (ByVal ta As Long, ByVal channel As Integer, buffer As Integer, ByVal<br />

nsamples As Integer) As Integer<br />

Remarks<br />

gage_transfer_buffer_3 is used to copy nsamples points from the specified channel to the supplied<br />

buffer beginning from address ta. The channel can be either GAGE_CHAN_A or GAGE_CHAN_B. The<br />

relevant addresses can be obtained by calling gage_calculate_addresses. . The buffer must have been<br />

previously typecast to the appropriate size. For 8 bit <strong>CompuScope</strong>s, the buffer should typecast for uInt8<br />

values. For <strong>CompuScope</strong>s with more than 8 bit resolution, the buffer should typecast for int16 values.<br />

The <strong>CompuScope</strong> PCI boards will use PCI bus-mastering if available in hardware, otherwise a CPU<br />

mediated PCI data transfer method is used. PCI bus-mastering is the fastest possible PCI data transfer<br />

method.<br />

The buffer must be padded so that it is slightly longer than the memory required to store nsample samples.<br />

The required amount of padding is different for different <strong>CompuScope</strong> models. The best padding method<br />

is to use the variable user_buffer_padding, which is returned by the drivers and is the amount of extra<br />

padding in Bytes required for the current <strong>CompuScope</strong> model.. Simply add user_buffer_padding to the<br />

amount of memory to be allocated.<br />

Unlike gage_transfer_buffer, in single channel mode gage_transfer_buffer_3 automatically downloads<br />

data from both <strong>CompuScope</strong> A/D converter memories and internally interleaves them. Consequently,<br />

the user application does not need to interleave the data when the acquisition has been performed in<br />

single channel mode using gage_transfer_buffer_3. In single channel mode, gage_transfer_buffer_3<br />

need only be called once with channel equal to GAGE_CHAN_A<br />

Return Value<br />

Returns an offset from the beginning of the dword-aligned buffer that the driver uses.<br />

Internally using PCI bus-mastering, PCI <strong>CompuScope</strong> hardware can only transfer data from a d-word (4<br />

byte) boundary in <strong>CompuScope</strong> on-board memory. For instance, data can be downloaded starting from<br />

hexadecimal addresses 0x3000 or 3004, but not starting from hexadecimal addresses 0x3001.<br />

The returned offset gives the byte address location of the address ta, specified in the call to<br />

gage_transfer_buffer_3. For instance, if ta were equal to hex 0x3003, then the <strong>CompuScope</strong> would be<br />

forced to download data from hexadecimal addresses 0x3000. The offset would then be returned as<br />

0x3003 – 0x3000 = 3.<br />

See also: gage_transfer_buffer and Appendix: Comparison of Various Data Transfer Routines.<br />

Examples:<br />

<strong>CompuScope</strong> API Reference <strong>Manua</strong>l<br />

53

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

Saved successfully!

Ooh no, something went wrong!