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

gage_force_capture:gage_busy:gage_abort_capture:gage_calculate_addresses:gage_select_board:gage_transfer_buffer_3:How the Memory is ReadForces the capture of data by the <strong>CompuScope</strong> board(s).Determines if the <strong>CompuScope</strong> board is busy capturing the data.Used to regain control of the <strong>CompuScope</strong> board(s).Returns the starting, trigger and ending addresses.Sets the driver so that the current board is the board identified bythe number passed to the routine.Copies the number of sample points in the <strong>CompuScope</strong> board’smemory space, from the specified channel to the supplied bufferusing bus-mastering. This routine returns an offset to the beginningof the d-word aligned buffer that the driver uses.The memory is read from the boards in a for loop using the gage_transfer_buffer_3 routine. The syntaxfor gage_transfer_buffer_3 is as follows:-Syntax:uInt32 GAGEAPI gage_transfer_buffer_3 (int32 ta, int16 channel, void far *buffer, int32 nsamples);gage_transfer_buffer_3 is used to copy nsamples points from the specified channel to the supplied bufferbeginning from address ta. The channel can be either GAGE_CHAN_A or GAGE_CHAN_B. Therelevant addresses can be obtained by calling gage_calculate_addresses routine. The buffer should betype cast to the appropriate size before accessing it. <strong>CompuScope</strong> 8-bit boards should be typecast to uInt8.<strong>CompuScope</strong> 12 and 16 bit boards should be typecast to int16. The <strong>CompuScope</strong> PCI boards will use busmasteringif available, otherwise this routine is the same as gage_transfer_buffer. The buffer must beslightly longer than the size required to store nsample samples. The extra buffer space required isdetermined by the variable board_info-> user_buffer_padding which is returned by the driver.The application does not need to interleave the data when the acquisition has been performed in singlechannel mode, as is the case with gage_transfer_buffer and gage_transfer_buffer_2.gage_transfer_buffer_3 returns an offset in Bytes to the beginning of the D-word aligned buffer that thedriver uses. The offset is the difference in Bytes between the pointer passed to the driver and the bufferthat the driver uses.Each board is selected in sequence by calling the routine gage_select_board.By default, all the post trigger data are read starting from the trigger address (the address where the triggerevent occurred). You can easily change this address in order to download data starting from anotheraddress. For example, by default the program has the following line:location = trigger; points = board.depth;where trigger contains the trigger address. If you change the code to:location = trigger - 100; points = 200;The program will read 200 samples starting from 100 points before the trigger address. In this way, theuser will download 100 points of pre-trigger data. Note that the start address determines the startingaddress of the valid pre-trigger data. If the difference between the trigger address and the starting addressis less then 100, then there will not be 100 valid pre-trigger data points. If you subtract the starting addressfrom the trigger address, you must take into account the fact that the memory is configured as a circularbuffer. The gage routine gage_normalize_addresses can be used to determine the difference between thetwo addresses taking into account the circular buffer.<strong>CompuScope</strong> <strong>SDK</strong> <strong>Manua</strong>l Page 45

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

Saved successfully!

Ooh no, something went wrong!