User Tools

Site Tools


New Driver from Template

This chapter describes how to create a new driver on basis of an existing one. To create a new driver from scratch is described in the next chapter. In the following example a new driver for a Doremi hard disk player is created. The Doremi protocol is very similar to the Bonsai Drive protocol from Rosendahl, so this driver is used as template.

At first we need to configure a channel for the Doremi player, then the Bonsai driver is loaded. The help text shows which serial parameters are needed and the pinout of the serial cable. It is highly recommended to read this text. All Bonsai commands work with the Doremi as well, except the SelectClip command is different. So we need to change this command to use it with Doremi.

Via main menu Configure → Edit Devices or the icon, the Device Editor is launched. In the drop down field Device select the Bonsai Drive and then the command SelectClip. Finally click the Edit … button (see screenshot below).

Now we can change the source code of the SelectClip command.

the line

s = chr(34) + chr(49) + chr(0) + chr(val(p1))

has to be replaced by

s = chr(37) + chr(167) + chr(64) + chr(1) + chr(0) + chr(0) + chr(val(p1))

The Save button saves the changes.

To update the edited command in the database, it is necessary to click the UpdateCmd button. The next step is to recompile the script by pressing the Compile button (see screenshot above). Then we close the Device Editor and (very important) save the script. The next step is to test the edited command. If it works correct we want to have the changed driver in the Device Templates database (remember, currently the driver exists only in the current script (*.vc3 file), and not in the Device Database. Via main menu Configure → Edit Devices or the icon the Device Editor is launched again. We select the Bonsai Drive (this is our previously changed driver), and export the driver to a file (File → Export…). Now terminate the Device Editor and start it again, this time via Configure → Edit Device Templates…. Then use File → Import… to import the driver. Finally there is one more change to do. Select the new imported driver in the Driver drop down box. The field Manufacturer still contains “Rosendahl”. Replace this with “Doremi Labs”. and click Update Device.

create_driver_from_template.txt · Last modified: 2013/08/19 07:48 by admin