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.

op_mode, float tbs, int32 far *trig, int32 far *start, int32 far *end, int16 data);<br />

Note that the chan parameter in this routine is 0-based. That is, channel A is specified by 0 and channel B<br />

is specified by 1. The data variable is the data located at the raw trigger address. This must have been<br />

previously downloaded as described above.<br />

The recommended way of calculating Multiple Record addresses using the embedded ETBs in order to<br />

correct the trigger address and then downloading the record data 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 />

data = gage_mem_read_master (trig);<br />

gage_calculate_mra_addresses (gdi.board_type, gdi.board_version, chan-1, gdi.mode, tbs, &trig,<br />

&start, &end, data);<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 />

Due to varying amounts of inter-record padding throughout a Multiple Record Acquisition, the groups<br />

differ in size after embedded ETBs have been used to adjust the trigger addresses.<br />

An application program can check if Enhanced ETBs are available on the current <strong>CompuScope</strong> hardware<br />

by comparing the ee_options field of the gage_driver_info_type structure and comparing it against the<br />

EEPROM_OPTIONS_MULREC_ADJUST constant (defined in the EEPROM.H file). For example:<br />

gage_get_driver_info (&gdi);<br />

if (gdi.ee_options & EEPROM_OPTIONS_MULREC_ADJUST)<br />

printf ("embedded trigger bits available\n");<br />

Notes<br />

If you are using Multiple Record, you should generally not use a busy timeout. A busy timeout is usually<br />

used to abort a capture if it is not finished within a predefined amount of time. Because a Multiple Record<br />

capture is actually a series of captures, the Multiple Record acquisition can last a long and perhaps<br />

indeterminate amount if time. Consequently, an incorrect busy timeout value may prematurely abort<br />

Multiple Record acquisition before all the captures are complete. If you must use a busy timeout, make<br />

sure that the timeout value exceeds the longest possible total Multiple Record acquisition time.<br />

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

107

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

Saved successfully!

Ooh no, something went wrong!