23.11.2014 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.

as long the group number is less than or equal to the number of acquired groups. When the passed group<br />

number is not equal to the return value, this indicates that the passed group number is outside the rage of<br />

valid captured groups.<br />

The recommended way of downloading all the groups in a Multiple Record capture is shown below:<br />

gage_get_driver_info (&gdi);<br />

tbs = 1000000000 / sample_rate; /* tbs is time between samples in nanoseconds. The correct value must<br />

be passed to address calculation routines for correct operation */<br />

group = 1;<br />

while (group == gage_calculate_mr_addresses (group, gdi.board_type, gdi.depth,<br />

gdi.max_available_memory, chan, gdi.mode, tbs, &trig, &start, &end) {<br />

}<br />

size = end - trig +1;<br />

offset = gage_transfer_buffer_3 (trig, GAGE_CHAN_A, buffer, size);<br />

display_data(offset); /*User-supplied routine that displays buffer, beginning at offset*/<br />

group++;<br />

The above sample code assumes that the buffer has already been allocated. The capture was in dual<br />

channel mode and only data from channel A is being transferred from the <strong>CompuScope</strong> acquisition<br />

memory to PC memory.<br />

Note that size was calculated to be end – trig +1. In Multiple Record mode there is no pre-trigger data, so<br />

the end address will always be greater than the trigger address.<br />

The above method is convenient if you don't know the total number of groups that have been captured<br />

because of the inter-record padding. If you've aborted the capture after a predetermined number of groups,<br />

or the driver routine gage_multiple_record_acquisitions is available for your <strong>CompuScope</strong> board, you<br />

can use a for loop to read only the number of groups of interest.<br />

Embedded Enhanced Trigger Bits<br />

A factory option available on most <strong>CompuScope</strong> boards with Multiple Record is Embedded Enhanced<br />

Trigger Bits. Due to the architecture of the <strong>CompuScope</strong> Multiple Record hardware, there is some<br />

uncertainty inherent in the trigger address because the least significant bits of this address are not<br />

maintained. The Embedded ETB option embeds the least significant bits of the trigger address (the ETBs)<br />

in an early sample of each Multiple Record group. After download, these embedded ETBs can be<br />

recovered and then used to resolve the trigger address uncertainty.<br />

On <strong>CompuScope</strong>s with the Embedded ETB functionality, the trigger address returned by<br />

gage_calculate_mr_addresses will point to the sample that that contains the enhanced trigger bits (ETBs).<br />

This sample must be downloaded using the gage_mem_read_master function as illustrated below:<br />

data = gage_mem_read_master(trig);<br />

In a Master/Slave <strong>CompuScope</strong> system, the ETBs for records from all <strong>CompuScope</strong>s in the system (Master<br />

and Slaves) must be downloaded from the Master <strong>CompuScope</strong>. Using the gage_mem_read_master<br />

function, as illustrated above, ensures that the ETBs are always downloaded from the Master <strong>CompuScope</strong>.<br />

The embedded ETBs are used to adjust the trigger address using the gage_calculate_mra_addresses<br />

function. The prototype of this function is shown below:<br />

int32 gage_calculate_mra_addresses (int16 board_type, uInt16 board_version, int16 chan, int16<br />

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

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

Saved successfully!

Ooh no, something went wrong!