Thursday, February 09, 2006
Introduction to the Software
When I bought my DCC set I included a Lenz LI101F computer interface. As a computer buff, with a desire to automate things, I couldn’t resist the temptation to build a computer controlled layout.
I intended to buy software to do the control and people seemed to be recommending Friewalds TrainController. I downloaded a trial version. At the time the only layout I had was a small double track oval. No point motors. No feedback modules. All I could do was use a throttle to control the trains.
This was definitely overkill for such sophisticated and expensive software. And I also found that the trial version kept timing out after a very short period. (They, of course, don’t want people using the software for free, but I felt I needed longer playing time to decide whether I liked it or not). So for the time being I stayed with the hand controller.
But as a nosey sod, I couldn’t help but take a peek at the on-CD instructions that came with the PC interface. At eighty pages of techno talk they where enough to put any sane individual off writing his own software. But I’m a fairly good Delphi programmer. And I really wanted computer control.
So, one afternoon, like an alcoholic dramatically falling off the wagon, I started writing some code. Actually, once you get down to it and realise that the worst of the technical stuff is completely irrelevant stuff that only affects the communications between the PC module and the command station I realised it wasn’t so difficult at all.
It’s just a long list of commands and responses that need to be implemented: “Set loco speed and direction”, “Set loco functions”, etc. It was just a case of starting at one end and working my way to the other.
So after a couple of afternoons work I had a basic throttle available on the computer, and was enjoying a thrill from driving a train via the PC that, for some reason, isn’t present when using the hand controller. Maybe it’s just because I wrote the software, a bit like the way food tastes better when you’ve cooked it yourself.
Feedback
So it was Christmas, and I was making plans to start on the proper layout. I needed to work out how to do feedback and turnout control from the PC in order to know how to build such things into the layout from the start rather than having to modify it later.
So I wired up some block sensors and a feedback module to a small test track and made a start on adding feedback code to the computer. All fairly simple - if you know how.
I’d pretty much decided that adding a nice layout plan to the software with the ability to switch points and plan routes would be great but probably best left to a proper piece of software. But I fell of the wagon a second time and found myself writing code for a pretty layout designer, to which I added my feedback modules.
The Present
Which brings things to the current date. With the outside loop of the layout laid and wired I was soon bored with running a single train around at a time. I wanted my computer driving the trains. Which, with the current layout, basically means I want a passenger train which stops at the station with every loop and a goods train which slowly follows. The fast passenger train being checked at the signals when it catches up with the goods. The goods waiting outside the station while the passenger stops to pick up and set down passengers.
And from there a want the computer to select a road into the fiddle yard for me and to choose which train to run so I can sit back and just watch trains go by.