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.

Description of the Routines used by the sample programFollowing are the routines used by the sample program DIGITAL_INPUT. A brief description for all theGage API routines used by each of the following routines is also given. For detailed description of all theGage API routines, please see the <strong>CompuScope</strong> API Reference <strong>Manua</strong>l.int CALLBACK WinMain . . . . . . . .This is the main routine in DIGITAL_INPUT.C. In this routine, we first initialize the <strong>CompuScope</strong> driverand hardware and verify the board structure for the <strong>CompuScope</strong> boards.We make setting adjustments using the board_settings routine and then prepare the <strong>CompuScope</strong> boardfor data capture with the SetBoard routine.We then start the acquisition. Two driver routines: gage_triggered and gage_busy are used to monitor theprogress of the trigger event and the completion of the current data acquisition, respectively.Once the acquisition is complete, we determine the relevant addresses by callinggage_calculate_addresses. The data record is transferred to PC RAM using PCI bus-mastering bygage_transfer_buffer_3.For 8 bit mode, gage_transfer_buffer_3 routine returns 8 bit samples in an int8 space.For 16 bit mode, gage_transfer_buffer_3 routine returns 16 bit samples in an int16 space.For 32 bit mode, gage_transfer_buffer_3 routine returns 32 bit samples in an int32 spaceAfter the data are read, we save the data from the digital input to an ASCII data file called D_INPUT.DATin the current working directory.Gage API routines used by gage_transfer_buffer_3:gage_get_driver_info:gage_start_capture:gage_triggered:gage_force_capture:gage_busy:gage_abort_capture:gage_transfer_buffer_3:Fills a structure or record with the relevant information from thedriver variables about the current <strong>CompuScope</strong> board settings.Prepares the <strong>CompuScope</strong> hardware for data acquisition.Determines if the <strong>CompuScope</strong> hardware has encountered a triggerevent.Forces 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).Copies the number of sample points requested from the<strong>CompuScope</strong> board’s memory space from the specified channel tothe supplied buffer using bus-mastering. This routine returns anoffset to the beginning of the d-word aligned buffer that the driveruses.<strong>CompuScope</strong> <strong>SDK</strong> <strong>Manua</strong>l Page 51

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

Saved successfully!

Ooh no, something went wrong!