Logo Banner
Decoration Picture

Velleman K8000 - [NT programming]

Using the K8000 on Windows NT/XP

The standard libraries, shipped with the K8000, don't work on a Windows NT platform. This means your K8000 is useless under Windows NT4, Windows 2000, or Windows XP. When trying to run on a NT system, your application will just crash.

What is causing the problems?

The cause of your problems is not really a bug, it's just the way NT handles the I/O (input/output) ports. Where you can access all ports under Windows 98, Windows NT has a strict control over its I/O ports. You need to write a device driver, if you want to access I/O ports (because device drivers have a higher I/O access level than user mode applications). I tried finding more information on writing my own device driver, but it turned out nowhere. So, were there any existing device drivers?

Research on existing device drivers

After a search for device drivers, I first found the "NTPort Library", from ZealSoft. It worked great! But soon, I got tired of the shareware popups and stopped using it. I was prepared to pay for it, until ... I discovered a site with the "DriverLinx PortIO Driver". It was completely freeware!!! NTPort was removed from my system very quickly, why paying for something if you have an equivalent for free?

Learning how to use DriverLinx Library

One of the disadvantages (let's say: the only one) of the DriverLinx driver is, you need 2 setups for one application. But it was the only way to do it, so I've learned how to live with it. Back to K8000: if I wanted to use the DriverLinx driver for my K8000, I needed to modify the source code (For Visual Basic). Or at least: the module which was shipped with the K8000. This is done for compatibility reasons, now I could upgrade a Windows 98 project to a Windows 2000 project very quickly.

Implementing DriverLinx into your applications

There are a few steps you need to take, before you can get your K8000 applications to work:

  1. download driverlinx
  2. install driverlinx by clicking the setup and following the instructions. rebooting can be needed!
  3. download the modified visual basic module
  4. start a new "standard EXE" visual basic project
  5. add the module k8000.bas to your project

Now, you need to add some extra code to the Form's code window (see below). When you execute the project, I/O channel 1 will light up.

Private Sub Form_Load()
'call main routine in the k8000.bas module
main
'define I/O's as output, and set channel 1
ConfigAllIOasOutput
SetIOchannel 1
End Sub
Copyright ©1998-2010 Vanderhaegen Bart - last update: December 13, 2007