ASCOM Dome Driver (VB) |
Prior to developing your first driver, please familiarize yourself with the developer information we've provided at the ASCOM Initiative web site (internet required).
These instructions are based on developing using the Visual Basic Express version of the Developer Studio. If you have the full version things will be slightly different.
You must do the following in order to complete your implementation:
Switch to the Debug configuration and build the project. It should build without errors.
Add a test project to the solution. There are templates that can be used to add either a console or Windows Forms application:
Select the ASCOM Test Forms App (VB) or ASCOM Test Console App (VB) template.
Set a name for the test application and click on OK.
In the Wizard: set the same device type and model name as for the driver and select Create to build the test project.
Set the Test Application to Run at Startup.
Click on Debug and the test application should run. You should be able to select your application in the chooser. Selecting Properties should show the default setup dialog for your driver.
Trying to continue will generate errors because the additional properties have not been implemented.
Open the Driver.vb file and go through the empty properties and methods, adding code to make them work. See the ASCOM Dome spec. Add code in the test application to exercise and test each property or method.
Customize the Setup Dialog (SetupDialogForm) to provide the settings and other controls for your driver.
Use Conform to check that your driver fully implements the protocol. With the full version of Visual Studio it's possible to set the driver properties to run Conform in the debug – Start Options section. Conform must be set to run as 32 bits. This isn't possible with the Express versions.
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).
Place a breakpoint in your driver class constructor, then start debugging (go, F5). Your breakpoint will be hit when the test application creates an instance of your driver (after selecting it in the Chooser). You can now single step, examine variables, etc. Please review the test application and make changes and additions to activate various parts of your driver during debugging.
This is a great way to incrementally debug your driver's properties and methods.
|
||
|
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 Groups.IO forum. |