There are commercially available programs for controlling model railways, however for various reasons none of them suited my requirements. Some programs are written to mimic prototype block signalling practices and the like, which aren't appropriate for my layout, whilst others don't have very good programmability (they're mainly for on-screen control).

Although I'm- not a programmer as such (I'm actually an IT Manager) I do have a lot of knowledge and experience in programming. I decided therefore to write my own programs from scratch. What follows will probably only be clear to someone who is very familiar with computers and software!

I settled on using Microsoft Access for this, using Visual Basic (VBA) for the actual programs. It's software I've got a lot of experience in, and with a bit of care it is very controllable. It also saved me writing code for things like screen displays and data storage. The downside is that it does not control serial interfaces directly, it's also not multi-tasking but that isn't really a problem. I've used Access 2007 as that's what I have installed.

I've written a series of subroutines for the serial control...

  • Serial Control
  • Main Form

    I've created an Access form for manual control. At the moment this just has the track diagram and points control on it, but loco control will be added.

    Rather than draw all this manually I've got the track coordinates in a table and have written a VBA routine to create the form.

  • Building the Control Form
  • The resultant form looks like this...

    This is from an earlier design of the layout so isn't accurate, and there's a glitch in the coordinates around Point 8! Clicking on the point number changes that point (and the colour of the representative lines).


    Although I've got some thoughts on this I haven't coded it yet. It will probably be based around the Ladder diagrams commonly used in machine control applications, with a timed event against the control form to actually scan inputs and check for the next events in the "ladder".

    I have done a test routine though to prove the control system works. You can see it in action on YouTube (I believe this may be the world's most boring model railway video).


    Back | Home | Up | Next