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.

Appendix A<br />

Comparison of Various<br />

Data Transfer Routines<br />

Buffered Access Routines<br />

All buffered routines read a block of data from <strong>CompuScope</strong> on-board memory; achieving high data<br />

transfer rates and thus allowing significant optimization of application performance. However, most<br />

buffered routines have access to only one <strong>CompuScope</strong> A/D converter's memory at a time. Therefore, in<br />

single channel mode, these routines will read only the odd or the even samples. The two buffers must be<br />

interleaved later by the user applications. In dual channel mode no interleaving is necessary, since each<br />

A/D converter's memory holds the data from a separate input channel. The only exception is the<br />

gage_transfer_buffer_3 routine which, when called in single channel mode, automatically downloads the<br />

data from both A/D converters' memories and does the interleaving within the drivers.<br />

The gage_transfer_buffer and gage_trigger_view_transfer routines provide a CPU mediated data<br />

transfer (i.e., a transfer where the CPU acts as mediator between host memory and the <strong>CompuScope</strong><br />

board). The only difference between the two routines is in how the addresses for data to be downloaded<br />

are specified. gage_transfer_buffer transfers data starting from the absolute address given as one of the<br />

parameters. By contrast, gage_trigger_view_transfer transfers data starting from a reference address<br />

position. This reference address is available in the trigger_view_offset global driver variable, which is set<br />

by the function set_trigger_view_offset. For both the gage_transfer_buffer and<br />

gage_trigger_view_transfer routines, the user application must allocate and provide a host buffer of<br />

sufficient size to hold the requested data.<br />

For PCI (CP500) <strong>CompuScope</strong>s, there is no intrinsic limitation on the amount of data that can be<br />

transferred at a time by gage_trigger_view_transfer. However, the gage_trigger_view_transfer routine<br />

can only transfer 4 KSamples at a time on ISA bus <strong>CompuScope</strong>s. Several of these transfers can be<br />

chained together using the gage_set_trigger_view_offset routine to form one larger transfer, as shown<br />

below:<br />

offet = 0;<br />

position = 0;<br />

while (depth > 0)<br />

{<br />

if (depth > 4096)<br />

transfer_depth = 4096;<br />

else<br />

transfer_depth = depth;<br />

gage_set_trigger_view_offset (offset);<br />

gage_trigger_view_transfer (GAGE_CHAN_A, (int16*) (buffer+position), transfer_depth);<br />

depth -= transfer_depth;<br />

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

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

Saved successfully!

Ooh no, something went wrong!