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 GAGEA2D_MUL_BM. A brief description for allthe Gage API routines used by each of the following routines is also given. For detailed description of allthe Gage API routines, please see the <strong>CompuScope</strong> API Reference <strong>Manua</strong>l.For a complete description of the SetDefaultBoardLocation, InitBoard, SetBoard, One_SetBoard andboard_settings, refer to their description in the previous section, which describes the GAGEA2D_MS_BMsample program.int CALLBACK WinMain . . . . . . . .This is the main routine in GAGEA2D_MUL_BM.C. In this routine, we first initialize the <strong>CompuScope</strong>driver and hardware and verify the board structure for the <strong>CompuScope</strong> boards.Next, we set the board setting variables by calling the board settings routine. These settings are actuallypassed to the hardware and the <strong>CompuScope</strong> boards are prepared for data capture by the SetBoard routine.We then start the acquisition. As in single record acquisition, the gage_triggered routine is used to detectwhen the first trigger occurs. In multiple record mode, however, gage_busy remains active until the<strong>CompuScope</strong> has captured all multiple records. This occurs when the requested number of records, as setby gage_multiple_record_acquisitions_32, has been acquired for CP500, single PCI or cPCI<strong>CompuScope</strong>s. For older ISA and X12/PCI <strong>CompuScope</strong>s, however, multiple recording terminates andgage_busy becomes inactive only when on-board memory is full.We determine the relevant addresses by calling gage_calculate_mr_addresses for each group. Thegage_calculate_mr_addresses routine returns the addresses for a specific group. If the addresses are read,the return value is the group number that was passed to the routine. In this way, we can loop until all thegroups are read. When this occurs, we know that there are no more groups to be downloaded. Within thisloop we also check if the board supports embedded enhanced trigger bits (EETBs). If the board supportsEETBs, we then call the gage_calculate_mra_addresses routine to adjust the trigger address according tothe EETBs. The gage_calculate_mra_addresses routine is required due to the architecture of thehardware. Depending on the <strong>CompuScope</strong> model, some lower trigger address bits are not stored on the<strong>CompuScope</strong> but must be embedded in the data records, typically in the first sample of each multiplerecord group. Using the gage_calculate_mra_addresses routine, the sample program extracts the EETBsand corrects the trigger address as required.The CP500 <strong>CompuScope</strong>s have the capability of specifying the number of groups to capture rather thanfilling up all of the onboard memory. Each group from the specified channel is saved to an ASCII file inthe current working directory. The raw data from a <strong>CompuScope</strong> board has the most positive voltagerepresented as the least positive value and the least positive voltage represented as the most positive value.To change this for the purposes of plotting the data, we negate the raw values for the 12 bit boards andsubtract them from 255 for 8 bit boards.For example, in dual channel mode the file names are as follows:GAGE_MUL_BM_DUAL_CHANA_GR1.DAT, contains the data of group 1 of channel A.GAGE_MUL_BM_DUAL_CHANB_GR1.DAT, contains the data of group 1 of channel B.GAGE_MUL_BM_DUAL_CHANA_GR2.DAT, contains the data of group 2 of channel A.GAGE_MUL_BM_DUAL_CHANB_GR2.DAT, contains the data of group 2 of channel B.…….In single channel mode the file names are as follows:GAGE_MUL_BM_SINGLE_GR1.DAT, contains the data of group 1.GAGE_MUL_BM_SINGLE_GR2.DAT, contains the data of group 2.GAGE_MUL_BM_SINGLE_GR3.DAT, contains the data of group 3.…….<strong>CompuScope</strong> <strong>SDK</strong> <strong>Manua</strong>l Page 47

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

Saved successfully!

Ooh no, something went wrong!