Hi,
I've just written this software program which will run my railroad. It's capable of running 64 outputs through the printer port. I'm only using 16 at the moment. This is stage 1, which is a computer based representation of a traditional looking panel. The next step will be to replace all the switches with track selectors, so you just select where and the points are set automatically. I've attached a pic of the front panel.
Its a DC layout, and eventually I hope to control the track power by computer as well.
The stop button will terminate the software. Once you select the turnouts you want, then by pressing the throw switch buttons the printer port will configure and turn a relay off or on to control the points.
I'm interested in any tips or anything that I might have overlooked. Any suggestions ?
I wrote this program with labview.It has 4 stages, Input, Process, Indicate and Output
Input stage reads the switches and converts the combination to a binary value.
Process stage, the binary value then is used to select a 'case'. Each case is configured to throw the required switches and indicate the path on the ladder.
Indicate stage. This is really an output, but is actually only a display driver. Each case will drive the required indicators to light the correct path. When the operator is happy the right path has been selected, then the output stage is ready.
Output stage. The operator presses the button which configures the printer port and throws the relays. This could be automated but I chose not to. Although I'm using the printer port, it would be extremely easy to convert the output to USB and run a I/O unit.
I would first use a graphics file (BMP, JPG, etc.) as an input for the screen background. The user would provide this. It would be a schematic of his layout. Each turnout control would then positioned by the user, in both (x,y) and rotation angle, to correspond to its position on the layout.
The output should allow for both momentary (twin-coil) and continuous (stall motor) turnouts. This would be, ideally, done on a switch-by-switch basis.
Make your printer-port I/O very modular in software design. Consider the very real possibility that the user might not have a printer port on his machine in the near future. (Think back to "game ports" on computers. These were 9 or 15-pin D connectors that were used for joysticks, etc. These have all gone to USB now, and its hard to find even after-market boards to support the old hardware and software. Even worse, the old drivers don't function under XP or Vista.) With printers going either USB or local network based through your router, it won't be long before manufacturers skip the printer-port output completely to save cost.
It takes an iron man to play with a toy iron horse.
I'm sure your having fun doing this yourself, but it has been done and you can get it for free. Take a look at www.oaktreesystems.com They have software and hardware to provide both computerized block control as well as detection and signaling for DC or DCC.
Sheldon
Have you written in a provision for a manual override? Lets say your computer crashes not like that ever happens........lol what happens to trains that are running switches etc. I have seen several large layouts that have computer controlled CTC machines to handle large numbers of trains as many as 40 and multiple switching operations is this geared towards something like that or the basic plywood central
I am interested in controlling my "N" scale trains from the computer. I plan on using DC control of blocks. Each block will have an IR detector at each end that will feed back to the computer so it (the computer) knows when a train enteres a block and leaves a block. I put a reflective tape under the tender and the caboose.
I want to use Micro Controllers (Parallax or other) to drive "H" bridges for each block that receive comands from the computer. MC will also be used to set switches and send back to the computer the IR detector information. It'd like the computer is the dispatcher, and the MC is the engineer.
Hope at least some of this makes sence to you. I think Misrosoft Visual Basic Ver 5 will do this for me. Quick Basic didn't seem to work in both directions at the same time, although I did get it to work in both way one at a time.
CTI Electronics also has a system that can be used for DC, and DCC if you decide to switch over sometime. http://www.cti-electronics.com/
I know you may be having fun, but if you don't want to re-invent the wheel........
I have used this system for a DC layout and it is really good in my opinion.
Elmer.
The above is my opinion, from an active and experienced Model Railroader in N scale and HO since 1961.
(Modeling Freelance, Eastern US, HO scale, in 1962, with NCE DCC for locomotive control and a stand alone LocoNet for block detection and signals.) http://waynes-trains.com/ at home, and N scale at the Club.
i like the program that you made!!!
i'd like to use it for my N scale layout
Aaron
Hiya, yes good point.Will build a simple switchbox that can take the place of the computer, with a DB25 plug on it so it will plug straight in. Cheers