Sample Programs Folder Structure used in<strong>CompuScope</strong> <strong>SDK</strong>sThe default directory for the <strong>CompuScope</strong> C/C++<strong>SDK</strong> sample programs is C:\Gage\<strong>CompuScope</strong> <strong>SDK</strong>for Windows\<strong>SDK</strong> for C-C++\. There are several example programs provided with the <strong>CompuScope</strong>C/C++ <strong>SDK</strong>. These sample programs each reside in their own Windows folder and acquire data usingseveral unique features of the <strong>CompuScope</strong> cards. Each folder contains all the files that are required tocompile the project in MS Visual C/C++.Each sample program is written to highlight a particular feature of the <strong>CompuScope</strong> hardware. Forexample, the gage_busmastering project is the simplest sample program that captures a signal on a single<strong>CompuScope</strong> card (in dual or single channel mode) and writes the data from all active channels to separateASCII data files. Data transfer is done using PCI bus-mastering.The list of all files contained in the gage_busmastering folder is as follows:Gage_busmasteringGage_busmastering.dswGage_busmastering.dspGage_busmastering.cGage_busmastering.hApp_supp.cApp_supp.hEeprom.hGage_drv.hGage_drv.libStructs.cStructs.hWhichdrv.hDebugGage_busmastering.exeGage_busmastering folder contains a subfolder named Debug. Debug folder consists of thegage_busmastering.exe, an executable built from the gage_busmastering project.The gage_busmastering project can be opened either by clicking on the gage_busmastering.dsw file or fromwithin the MS VC environment. If the project file gage_busmastering.dsw is opened in MS Visual C/C++and is rebuilt, then the executable will be created in the Debug folder.The layout of all other sample programs follow the same format as the one described above for thegage_busmastering project. Sample programs provided with the <strong>CompuScope</strong> C/C++ <strong>SDK</strong> have beenbuilt in the Microsoft Visual C 5.0 environment. These sample projects can also be compiled usingBorland Compiler. In order to do this, the user must simply collect the files required for the project andcreate a Borland project. Furthermore, the GAGE_DRV.LIB file must be modified using the IMPLIBfunctionality.Page 28<strong>CompuScope</strong> <strong>SDK</strong> <strong>Manua</strong>l
Common Files used in <strong>CompuScope</strong> C/C++ <strong>SDK</strong>sThe <strong>CompuScope</strong> C/C++ <strong>SDK</strong> source code is compiled with the so-called "<strong>CompuScope</strong> common files".The common files compiled into a C application program and those that have been compiled into the<strong>CompuScope</strong> drivers MUST be the same. Otherwise, application/driver incompatibility may result. Thecurrent are listed below:Eeprom.h,Gage_drv.h,Gage_drv.lib,Structs.c,Structs.h,Whichdrv.hGagePlus.hGageEx.libThe <strong>CompuScope</strong> C/C++ <strong>SDK</strong> and driver version naming scheme is the following: MAJORNUMBER.MINOR NUMBER.PATCH NUMBER. For instance, for the <strong>CompuScope</strong> driver version3.46.02, MAJOR NUMBER = 3, MINOR NUMBER = 46 and PATCH NUMBER=02. If the majornumber or minor number changes, the common files have been changed. For instance, <strong>CompuScope</strong> driver3.46.02 and C <strong>SDK</strong> version 3.46.00 share the same common file, while <strong>CompuScope</strong> driver 3.46.02 and C<strong>SDK</strong> version 3.50.00 do not.If you update your driver, to a version with newer common files, then your C application program mustalso be updated. For instance, if you developed an application using C <strong>SDK</strong> version 3.46.00 and you haveupgraded your drivers to version 3.50.000, then you must update your application program in order to avoidincompatibility and potential incorrect operation.In order to remove incompatibility between <strong>CompuScope</strong> driver and <strong>CompuScope</strong> C/C++ <strong>SDK</strong>, you willneed to re-compile your C/C++ code with the common files associated with this new <strong>CompuScope</strong> driver.This will re-establish compatibility between your <strong>CompuScope</strong> C/C++ <strong>SDK</strong> and the <strong>CompuScope</strong> driver.For your convenience, the common files are installed with the <strong>CompuScope</strong> drivers in the C:\Gagedirectory. Simply copy these files into your application directory, overwriting the old ones, and recompile.Brief Description of the Common FilesThe <strong>CompuScope</strong> common files can be categorized as either source files, header files or library files. Abrief description of each common file is given as follows:Source File• Structs.cStructs.c is a source file that implements and initializes all useful data structures and variablesused to describe the <strong>CompuScope</strong> hardware capabilities and states. Examples includeboarddef, srtype and irtype structure types. These structure types are used by all sampleprograms provided in the <strong>CompuScope</strong> C/C++ <strong>SDK</strong>s for Windows. Please open the Structs.csource file in either a text editor (MS Note Pad, MS Word Pad, etc) or in the MS Visual Cenvironment to view the contents.Header Files• Eeprom.hEeprom.h is one of the header files provided with the <strong>CompuScope</strong> drivers. This file containsthe definition of constants determining OPTIONS supported by <strong>CompuScope</strong> hardware.These options include features such as Multiple Record, Master/Slave upgrade and Externalclock option. For a detailed list of possible hardware features provided, view the contents ofthis file in either a text editor or in the MS Visual C environment.<strong>CompuScope</strong> <strong>SDK</strong> <strong>Manua</strong>l Page 29