Home
I've written the software to drive the controller myself. This way; 1. it does exactly what I want it to, 2. if it does work it's my own fault, and 3. I can build into it things like fixing a cabling error without having to re-wire the controller! So I downloaded Microsoft Visual Basic, and starting playing around with that.
UNDER DEVELOPMENT
More info - Controller
More info - Relay boards
More info - Sequencing software

More info - Countdown clock
More info - Wiring / Power
More info - Mounting
More info - Videos
History
Software
Home
History
Contact
Santa Boots
Controller
Relays
The first hitch when developing the program to for the controller (ie. sending data to the computer's parallel port) was that you can't directly access the parallel port using Visual Basic under Windows XP. A quick google search found the answer - you'll find everything you need to know about parallel port programming HERE. Basically it required a DLL to be loaded, and you call this to write to the parallel port.
The first program I wrote was basically used to debug the controller, with a couple of buttons to run various pre-programmed functions... everyone building a controller will need a program like this! It also included a simple visual display to show the status of what pins should be high (X), as well as the option to step through a multi-write (it takes 6 writes to set a value on one of the flip-flops).
Once the controller was working, it was then time to start thinking about building a sequence player - after all, what's the point of having a controller if you don't make full advantage of it? The way I considered it, I would need one program in which to do sequence design, and another simple program which would run the sequences on the controller.
The program that runs the sequence is quite simple. First it reads the sequence file. Included in the sequence file is the filename of the .WAV (music) file to play. It loads the music file into memory (this is done to remove uncertainly with timing when playing from the disk).
It then starts running the sequence, and after a specified amount of time, it starts playing the music file.
At the end of the sequence, it loads and runs the next sequence (if no next sequence is specified it ends).
I also added a Test Performance button, as I was worried about how fast the computer I was using would be able to write out the data for all 16 ports. As it turns out, it does it VERY quickly, all 16 ports can be written to in around one hundredth of a second.
I started writing the sequence player in VB, and then the sequence developer I decided to write using MS-Access (having had quite a bit of experience in MS-Access before I though this would be far easier than doing it in VB, and by using Access I didn't have to worry about complicated file writing & reading, I just store all the sequences in an access table, and write them out as a simple text file).
Screen Shot - Sequence Developer
This isn't yet tested "in the field", so I'm expected a bit more development work before it's fully operational! And if you're wondering why I start the sequence, then wait a while, and then start the music - the reason is that I was testing with LED's, which light up quite quickly, however, when I plugged a real set of christmas lights in to test the relay board, I found that there's a definate lag between when the port is switched on, and when the lights actually light up (a warm up period). My rough guess is that it's around 80 milliseconds (that's only 0.8 of 1/10th of a second, but it's noticable), so I've built in the ability to start the music slightly behind (or ahead) of the controller sequence so that I can develop the sequence in exact time to the music, and then allow for the lag the christmas lights take to light up.
Software
Countdown Clock