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.

the data whose address was specified by the trigger_view_offset global driver variable. For<br />

instance, let us assume that the user requested transfer of data starting from <strong>CompuScope</strong> onboard<br />

memory address hex 0x3002. This is done by passing 0x3002 as the first argument to<br />

gage_transfer_buffer_3 or by setting the value of the trigger_view_offset global driver variable to<br />

0x3002 before calling gage_trigger_view_transfer_3 Due to its hardware architecture, the<br />

<strong>CompuScope</strong> would be forced to download data from hexadecimal addresses 0x3000.<br />

gage_transfer_buffer_3 and gage_trigger_view_transfer_3 would then return an offset with the<br />

value of 0x3002 – 0x3000 = 2. This returned offset of 2 indicates that the start of the requested<br />

data is in the 3 rd byte of the host memory buffer (0 means 1 st Byte, 1 means 2nd Byte, etc).<br />

2. The second feature is that the data from both A/D converter memories are automatically<br />

interleaved in single channel mode. Behind the scenes in single channel mode, both<br />

gage_transfer_buffer_3 and gage_trigger_view_transfer_3 download the data from both A/D<br />

converter memories and interleaves them within the driver. The user is then presented with the<br />

complete single channel mode data record. Therefore, the application does not need to interleave<br />

the data when the acquisition has been performed in single channel mode. By contrast, in the<br />

case of gage_transfer_buffer, gage_trigger_view_transfer, gage_transfer_buffer_2 and<br />

gage_trigger_view_transfer_2, it is the application’s responsibility to interleave the transferred<br />

data in single channel mode. Since they are easier to use, therefore, gage_transfer_buffer_3 or<br />

gage_trigger_view_transfer_3 should be used for new software development.<br />

Single Sample Access Routines<br />

gage_mem_read_chan_a and gage_mem_read_chan_b<br />

These functions read one sample (which is 1 byte for 8 bit <strong>CompuScope</strong> boards and 2 bytes for 12, 14 and<br />

16 bit <strong>CompuScope</strong> boards) from <strong>CompuScope</strong> on-board memory for channel A or channel B respectively<br />

in dual channel mode. The functions are usually used to read relatively small amounts of data or to read<br />

non-sequential data from a <strong>CompuScope</strong> board regardless of the operating mode.<br />

gage_mem_read_dual is very similar to gage_mem_read_chan_a and gage_mem_read_chan_b. It<br />

reads one sample from <strong>CompuScope</strong> memory in dual channel mode, having the channel number as one of<br />

the parameters. This function is best suited for an application where there is prior knowledge that the data<br />

acquisition will be occurring in dual channel mode and both channels should be read.<br />

gage_mem_read_single is the counterpart of gage_mem_read_chan_a and gage_mem_read_chan_b for<br />

single channel mode. All three of these routines maintain the same parameters and return values<br />

gage_mem_read_master reads one sample from <strong>CompuScope</strong> memory for channel A of the Master<br />

<strong>CompuScope</strong> board. The Gage drivers detect the mode of operation, single or dual channel. This function<br />

is mostly used in conjunction with gage_calculate_mra_addresses to read embedded enhanced trigger bits<br />

from <strong>CompuScope</strong> memory. Embedded ETB information must always be read from the Master<br />

<strong>CompuScope</strong>.<br />

All Single Sample Access or gage_mem_read routines provide a “read ahead” caching mechanism, which<br />

reads a larger block of data from the <strong>CompuScope</strong> memory behind the scenes. This allows faster response<br />

of multiple calls to a gage_mem_read routine in order to download sequential data points. The size of the<br />

cache buffer, however, varies among the <strong>CompuScope</strong> boards. When call to a gage_mem_read routine is<br />

made, behind the scenes the driver downloads a multi-point block of data from <strong>CompuScope</strong> memory.<br />

This block is then stored in the driver and is used as long as address locations for subsequent<br />

gage_mem_read calls fall within it.<br />

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

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

Saved successfully!

Ooh no, something went wrong!