Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.astro.louisville.edu/software/sbig/archive/xmccd-4.2.1/xmccd-4.2.1/docs/sbig/SBIGUDrv.pdf
Дата изменения: Sat Apr 27 06:23:29 2013
Дата индексирования: Sun Apr 10 06:01:34 2016
Кодировка:

Поисковые слова: п п п п п п п п п п п п п п п п п п п
SBIG Universal Driver/Library
Version 4.75 Build 5 October 18, 2012

Santa Barbara Instrument Group 147A Castilian Drive Santa Barbara, CA 93117 Phone: (805) 571-7244 Fax: (805) 571-1147 Web: EMail:


Santa Barbara Instrument Group Table of Contents
1. 2. 2.1 2.2 2.3 3. 3.1 3. 3. 3. 3. 3. 3. 3.2 3. 3. 3. 3. 3. 3. 3. 3. 3.3 3. 3. 3. 3.4 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.5 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.

Universal Driver Application Note

Introduction............................................................................................................................................................... 4 Operating System Specifi Microsoft Windows ...... Macintosh OSX ............ Linux ........................... c .. .. .. Instructions ..................... .................. ... ... .................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 5 5

Driver Interface ................................................... Driver Related Commands ................................ 1.1 Open Driver ................................................. 1.2 Close Driver ................................................. 1.3 Open Device ................................................. 1.4 Close Device ................................................ 1.5 Get Driver Info ............................................. 1.6 Get/Set Driver Handle .................................. Exposure Related Commands ............................ 2.1 Start Exposure, Start Exposure 2 Commands 2.2 End Exposure ............................................... 2.3 Start Readout ................................................ 2.4 Readout Line ................................................ 2.5 Read Subtract Line ....................................... 2.6 Dump Lines .................................................. 2.7 End Readout ................................................. 2.8 Get Line........................................................ Temperature Related Commands ....................... 3.1 Set Temperature Regulation.......................... 3.2 Set Temperature Regulation 2 ....................... 3.3 Query Temperature Status ............................ External Control Commands ............................. 4.1 Activate Relay .............................................. 4.2 Pulse Out ...................................................... 4.4 TX Serial Bytes ............................................. 4.5 Get Serial Status ........................................... 4.6 AO Tip Tilt ................................................... 4.7 AO Center .................................................... 4.8 AO Set Focus ................................................ 4.9 AO Delay ...................................................... 4.10 CFW ........................................................ 4.11 Motor Focus............................................. General Purpose Commands.............................. 5.1 Establish Link ............................................... 5.2 Get CCD Info ............................................... 5.3 Get Turbo Status ........................................... 5.4 Query Command Status ................................ 5.5 Miscellaneous Control .................................. 5.6 Update Clock ................................................ 5.7 Read Offset ................................................... 5.8 Read Offset 2 ................................................ 5.9 Get US Timer................................................ 5.10 Set/Get IRQL............................................ 5.11 Get Link Status......................................... 5.12 Get Error String ....................................... 5.13 Set Driver Control.................................... 5.14 Get Driver Control ................................... 5.15 USB AD Control ...................................... 5.16 Query USB ...............................................

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

. ........ ......... ... ...... ... ...... ... ...... .... ..... ....... .. ......... ......... ......... ..... .... .... ..... .... ..... ......... .. ....... ... ...... ......... ......... ......... ......... ......... ......... ...... ... ......... ....... .. ......... . ........ ......... .... ..... ......... ......... ....... .. ......... ..... .... ..... .... ......... ......... ......... .... ..... . ........ .... ..... .... ..... ........ . ......... ......... ......... ......... ......... ..... ....

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

. ........ ......... ... ...... ... ...... ... ...... .... ..... ....... .. ......... ......... ......... ..... .... .... ..... .... ..... ......... .. ....... ... ...... ......... ......... ......... ......... ......... ......... ...... ... ......... ....... .. ......... . ........ ......... .... ..... ......... ......... ....... .. ......... ..... .... ..... .... ......... ......... ......... .... ..... . ........ .... ..... .... ..... ........ . ......... ......... ......... ......... ......... ..... ....

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

. ........ ......... ... ...... ... ...... ... ...... .... ..... ....... .. ......... ......... ......... ..... .... .... ..... .... ..... ......... .. ....... ... ...... ......... ......... ......... ......... ......... ......... ...... ... ......... ....... .. ......... . ........ ......... .... ..... ......... ......... ....... .. ......... ..... .... ..... .... ......... ......... ......... .... ..... . ........ .... ..... .... ..... ........ . ......... ......... ......... ......... ......... ..... ....

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

... 5 ... 6 ... 7 ... 7 ... 7 ... 7 ... 8 ... 8 .. . 9 ... 9 . 11 . 12 . 13 . 14 . 14 . 15 . 15 . 15 . 15 . 17 . 17 . 18 . 19 . 19 . 20 . 20 . 20 . 20 . 20 . 21 . 21 . 23 . 24 . 24 . 25 . 28 . 28 . 28 . 29 . 29 . 29 . 30 . 30 . 30 . 30 . 30 . 32 . 32 . 33

Page 2


Santa Barbara Instrument Group
3. 3. 3. 3. 3. 4. 4. 4. 4. 4. 4. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 1 2 3 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 5. 5. 5. 5. 5. 17 18 19 20 21 Query Ethernet...... Get Pentium Cycle RW USB I2C ......... Bit IO .................... Column EEPROM . .......... Count .......... .......... .......... .. .. .. .. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .. .. .. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .. .. .. .. . . . . . .

Universal Driver Application Note
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .. .. .. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 34 34 35 35 37 37 37 38 38 38 39 39 40 40 41 41 41 41 41 42 42 43 43 43

Windows Based Utility Programs ..................................... SBIGDriverChecker.exe and SBIGDriverChecker64.exe EthSim2.exe ................................................................... SBIGUDRVJournalRx.exe ............................................. SetClock.exe .................................................................. GetPortD.exe ..................................................................

.. .. .. .. .. ..

. . . . . .

.. .. .. .. .. ..

.. .. .. .. .. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

.. .. .. .. .. ..

Supporting New Cameras and Accessories .................................... Supporting the ST-L..................................................................... Supporting the Single Shot Color Cameras ................................... Supporting the ST-402 Camera and CFW-402 Filter Wheel ......... Supporting the CFW-10 Color Filter Wheel ................................. Supporting the I2C based AO Accessories..................................... Supporting the I2C based CFW-9, CFW-L8 and CFW-L8G Color Supporting the I2C based Motor Focus Accessory ......................... Supporting the I2C based low-cost A0-8 ....................................... Supporting the ST-4000XCM Single Shot Color Camera ............. Supporting the STX Cameras ....................................................... Supporting the ST-i Cameras ....................................................... Supporting the STF-8300 Cameras ............................................... Supporting the STT Cameras .......................................................

......... ......... ......... ......... ......... ......... Filter ....... .. ......... ......... ......... ......... ......... .........

............ ............ ............ ............ ............ ............ Wheels ............ ............ .......... .. ............ ............ ........ .... ............

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

. . . . . . . . . . . . . .

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

. . . . . . . . . . . . . .

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

. . . . . . . . . . . . . .

6. Revision History ........................................................................................................................................................... 44

Page 3


Santa Barbara Instrument Group

Universal Driver Application Note

1. Introduction This document describes the software interface to Santa Barbara Instrument Group's Universal Driver Library (SBIGUDRV). The SBIGUDRV driver supports all of SBIG's Parallel1, Ethernet and USB based cameras and accessories. The driver/library is available for Microsoft Windows, Macintosh OSX2 and Linux. Windows support is for the 32 bit versions of Windows 953 through Windows7 and 64 Bit versions of Windows XP through Windows7. The various development kits and supplemental downloads may contain the following files: SBIGUDRV.H - Use this include file with all programs calling the driver. It includes the function prototype and many struct definitions for interfacing to the driver. You need to set the TARGET variable based upon your target environment: Win 95/98/ME/NT/2000/XP ­ ENV_WIN Macintosh OSX ­ ENV_MACOSX Linux ­ ENV_LINUX One of the things we do with our development is create an LSBIGUDRV.H file where we set TARGET and then include the SBIGUDRV.H file. By including LSBIGUDRV.H instead of SBIGUDRV.H you can replace the SBIGUDRV.H file when it gets revised without having to edit it every time to reset the TARGET. SBIGUDRV.LIB - This is an import library that you link with your 32 bit Windows program. Include this in your "project" file. Windows Development Kit ­ Contains everything you need to start developing software for the Windows platform including the Windows Tool described below. Mac OSX Development Kit ­ Contains a USB driver installation package. Running the installer package installs the USB drivers and a Framework that implements the Universal Driver. Linux Development Kit ­ Contains a gzipped tar archive with the Universal Driver as a shared library and low-level Parallel Port and USB drivers. SBIG Driver Checker ­ This is an installer utility program for 32 bit versions of a Windows. A complete description is in Section 4. SBIG Driver Checker 64­ This is an installer utility program for 64 bit versions of a Windows. A complete description is in Section 4. \Tools ­ This directory contains some Windows utility programs that will help you get your custom program up and running with the SBIG Universal Driver/Library. See section 3 for a description of each of these tools. Visual C++ Sample Program ­ Includes a sample Visual Studio 6 project. Visual Basic Sample Programs ­ Includes some sample Visual Basic programs. SBIG C++ Sample Classes ­ Includes sample source code for CSBIGCamera and CSBIGImage classes. 2. Operating System Specific Instructions This section contains Operating System specific instruction on how to install the drivers and how to build projects that include the SBIG Universal Driver Library. 2.1 Microsoft Windows SBIG provides the SBIG Driver Checker utility for installing the camera drivers under 32 and 64 bit versions of Windows. This process is documented in the "Installing USB.pdf" file in the DOCS
1 2

3

Parallel cameras are only supported under 32 bit versions of Windows. Macintosh OSX does not support parallel port based cameras as these ports do not exist in the Mac world. Users with Parallel Port based cameras can use their cameras on Ethernet equipped Macs with OSX by using SBIG's optional Ethernet to Parallel (E2P) Adapter. There is no support for USB based cameras under Windows 95 or NT.

Page 4


Santa Barbara Instrument Group

Universal Driver Application Note

directory. It's critical under Windows that you install the drivers correctly. Please follow that document to the letter. Once the drivers have been installed it's a good idea to run SBIG's CCDOps software to make sure you can talk to your camera. If you don't have CCDOps you can download it from our web site. This will confirm the proper driver installation and insure your camera is working correctly. Once the drivers are installed and your camera is working follow the instructions below to add the SBIG Universal Driver to your software project: Visual C Include the SBIGUDRV.H (or LSBIGUDRV.H) file in your C/C++ files that need to call the driver to get the function prototype, enumeration declarations and struct definitions. Add the SBIGUDRV.LIB file to your project so your project will link with the SBIGUDRV.DLL that was installed into the \Windows\System directory Visual BASIC Add the SBIGTypes.bas file to your Visual Basic project for the function declaration, enumeration declarations and type definitions. Note that Visual BASIC has no unsigned types so pixel data which the driver treats as an unsigned short (values 0 to 65535) but Visual BASIC treats as signed (values ­32768 to 32767) will have to be converted to long. Signed values 0 to 32767 convert directly whereas signed values ­32768 to ­1 convert to 32768 to 65535 respectively. Thus negative signed short pixel values convert to signed long values by "signed long = 65536 ­ signed short". 2.2 Macintosh OSX SBIG provides the SBIG Driver Installer package for installing the low-level USB drivers and the SBIG Universal Driver Framework. Double click this file to install the drivers and library. Once the drivers have been installed it's a good idea to run SBIG's CCDOps Lite for OSX software to make sure you can talk to your camera. If you don't have CCDOps Lite you can download it from our web site. This will confirm the proper driver installation and insure your camera is working correctly. Once the drivers are installed and your camera is working with CCDOps Lite add: #include to any source code that calls the SBIG Universal Driver Library to bring in the enumerations, struct definitions and function prototype. Also add to the project the following framework file to get the program to link without error: /Library/Frameworks/SBIGUDrv.framework 2.3 Linux Please see the README.txt file included in the Linux Development kit for detailed instructions on ho w to install the SBIG Universal Driver Library on your Linux system. 3. The shor acts for t Driver Interface software interface to the Universal Driver Library is through single external function that takes a t integer Command and pointers to command Parameter and command Results structs. The driver upon the Command and Parameters struct and fills in the Results struct. The memory allocation hese structs is the responsibility of the calling program. The C prototype for the function is shown in the SBIGUDRV.H file and takes the form: Page 5


Santa Barbara Instrument Group

Universal Driver Application Note

short SBIGUnivDrvCommand (short Command, void *Parameters, void *Results) where Command is the command to be executed and Parameters and Results are pointers to the structs. The function returns an error code indicating whether the camera was able to initiate o r complete the command. Note that enumerated types exist in the SBIGUDRV.H file for the Command (PAR_COMMAND) and function return result (PAR_ERROR) as well as many of the fields in the various Parameters and Results structs. The commands supported by the driver are grouped into the following sections discussed individually below: · · · · · Driver Related Commands Exposure Related Commands Temperature Related Commands External Control Commands General Purpose Commands

Getting back to the driver, it is written and documented assuming you are programming and proficient in C. As you can see, the function prototype is a C function (not C++), and as you will see the Parameters and Results parameters will end up being pointers to structs using the following data types within the structs: LOGICAL - unsigned short (2 bytes) with 0 = FALSE and 1 = TRUE enum - Enumerated unsigned short (2 bytes) with an allowed set of values short - signed short (2 bytes) ushort - unsigned short (2 bytes) long - signed long (4 bytes) ulong - unsigned long (4 bytes) Some commands don't require Parameters structs and some don't require Results structs. In those cases you should pass a NULL pointer to the driver. The supported commands are discussed in the sections below. For each command the Parameters and Results structs are shown except in the case where one or both do not exist. The function error return codes for each of the commands will vary from command to command. For each command that doesn't operate immediately, a command status is maintained internally by the driver, and can be monitored with the Query Command Status command. The command status for each of the commands varies from command to command but in general will be from one of the following: 0 = Idle 1 = Command In Progress 3.1 Driver Related Commands The Commands in this section are used to open and close the driver and get driver related informatio n. At the application level you must Open the Driver (allowing access to the top level of the driver) and then Open the Device (selecting the hardware interface) in order to communicate with the camera.

Page 6


Santa Barbara Instrument Group

Universal Driver Application Note

3.1.1 Open Driver The Open Driver command is used to initialize the driver and should be your first call to the driver. It takes no Parameters and returns no Results. Just pass NULL pointers to the Parameters and Results arguments of the SBIGUDrvCommand function when you call it. 3.1.2 Close Driver The Close Driver command is used to close the driver and should be your last call to the driver. There must be one call to Close Driver for each call to Open Driver. This command takes no Parameters and returns no Results. Just pass NULL pointers to the Parameters and Results arguments of the SBIGUDrvCommand function when you call it. 3.1.3 Open Device The Open Device command is used to load and initialize the low-level driver. You will typically call this second (after Open Driver). Parameters Struct: struct OpenDeviceParams { enum deviceType (see the SBIG_DEVICE_TYPE enum) 0 = unused 1,2,3 ­ LPT 1,2,3 0x7F00 ­ USB 0x7F01 ­ Ethernet 0x7F02 ­ USB1 0x7F03 ­ USB2 0x7F04 ­ USB3 0x7F05 ­ USB4 ushort lptBaseAddress ­ for LPT1,2,3 base port address of the LPT port ulong ipAddress - for Ethernet the IP address of the camera/accessory } This command returns no Results. Just pass a NULL pointer to the Results argument of the SBIGUDrvCommand function when you call it. Notes: · The lptBaseAddress is required for LPT1,2,3 under Windows 95/98/Me. This is typically 0x378 for LPT1 and 0x278 for LPT2 but can vary from machine to machine and can be found from the Device Manager control panel. Under Windows NT/2000/XP you can leave this set to 0 as the driver gets this information from the OS. · The ipAddress is required for Ethernet. Use the four bytes of the long with the most significant byte specifying the first part of the address. For example if the desired IP address is 192.168.0.1 use 0xC0A80001 (0xC0=192, 0xA8 = 168, etc.) · When using the Open Device command for opening USB devices, specifying USB (DEV_USB = 0x7F00) opens the next available USB device which may not be what you want in situations with multiple USB cameras. In these cases use the Query USB command first to see what model cameras are available then specify USB1, USB2, USB3 or USB4 to open those specific cameras. 3.1.4 Close Device The Close Driver command is used to close the low-level driver. You will typically call this second to last (right before Close Driver). There must be one call for Close Device for every call to Open Device.

Page 7


Santa Barbara Instrument Group

Universal Driver Application Note

The Close Device command takes no Parameters and returns no Results. Just pass NULL pointers to the Parameters and Results arguments of the SBIGUDrvCommand function when you call it. 3.1.5 Get Driver Info The Get Driver Info command is used to determine the version and capabilities of the DLL/Driver. For future expandability this command allows you to request several types of information. Initially the standard request and extended requests will be supported but as the driver evolves additional requests will be added. Parameters Struct: struct GetDriverInfoParams { enum request - type of driver information desired (see the DRIVER_REQUEST enum) 0 = Standard request 1 = Extended request 2 = USB loader request 3, etc. - reserved for future expansion } Standard, Extended and