ASCOM Focuser Driver (VB)

You have just created the skeleton of an ASCOM Focuser driver in VB. It produces an in-process (assembly) based driver.


Prior to developing your first driver, please familiarize yourself with the developer information we've provided at the ASCOM Initiative web site (internet required).

You must do the following in order to complete your implementation:

  1. BEFORE BUILDING! Double-Click MyProject, select the Application tab. Change the assembly name to ASCOM.Parallel_Stepper_Focuser.Focuser and the root namespace to ASCOM.Parallel_Stepper_Focuser. This could not be automated in the template.
  2. Switch to the Debug configuration and build the template now. It should build without errors.
  3. Double-click the Test.vbs script for a quick check of your driver. It activates only the SetupDialog() method, so it will run after you build the template successfully, even if you haven't yet implemented any of the properties and methods.
  4. Open the Driver.vb file, then show the Task List and select Comments. This will show you the places where you need to add or change things for your driver. Tasks include implementing the required properties and methods. See the ASCOM Focuser spec.
  5. Customize the Setup Dialog (SetupDialogForm) to provide the settings and other controls for your driver.

Notes:

  • Successfully building the driver, as well as using regasm on the assembly, registers it for both COM and ASCOM (the Chooser). See the code in the ASCOM Registration region of Driver.vb.
  • Doing a Clean for the project, as well doing a regasm -u on the assembly, unregisters it for both COM and ASCOM (the Chooser).
  • The project's Debug configuration is already configured (note) for driver debugging using the supplied Test.vbs script. Place a breakpoint in your driver class constructor, then start debugging (go, F5). Your breakpoint will be hit as soon as the test script creates an instance of your driver (after selecting it in the Chooser). You can now single step, examine variables, etc. Please review Test.vbs and feel free to make changes and additions to activate various parts of your driver during debugging. You can bypass the appearance of the Chooser by removing

    Set F = CreateObject(H.Choose("")) ' Create instance of selected Driver

    and substituting

    Set F = CreateObject("ASCOM.Parallel_Stepper_Focuser.Focuser)

    This is a great way to incrementally debug your driver's properties and methods. Create additional scripts in either JScript or VBScript. To change the script that is used to activate the driver during debugging, open Project Properties, Debug tab, and change the script name in the Command Line Arguments field.

(*) If you're running on Windows 2000, you'll have to change the path to cscript.exe in your project properties, Debug tab, Start External Program. Change c:\windows\ to c:\winnt\. This was unavoidable because VS.NET doesn't support substitution macros in this field.

ASCOM Initiative

logo

The ASCOM Initiative consists of a group of astronomy software developers and instrument vendors whose goals are to promote the driver/client model and scripting automation.

See the ASCOM web site for more information. Please participate in the ASCOM-Talk Yahoo Group.