Need some advice (DCC)

Morning all, I need to pick the brain of a DCC expert or two.

I am jumping back in to Model Railroading after about a 10 year hiatus due to being active duty Navy. I was an electrician and studied solid state electronics so i understand the communications aspect of DCC in pretty good detail, but I have been trying to research what brand to buy that will meet my needs and haven’t came up with much.

I am looking for a system that can be 100% controlled from a computer if need be, aka, completely automated operations. I can take care of blockocc and such, but I am having issues determining which DCC manufacturers offer either RS-232/485 or USB interfaces. Lenz has a USB interface, but I cannot find any documentation on how to write software for this protocol… an API would be great. Digitracks also has a USB and a RS232/485 interfaces, but the digitracks website states its for monitoring only.

Anyone ever attempt something along these lines?

I have never used any computer automation, but on the Tony’s Train Exchange website I have seen several automation items listed. They are also very helpful. I would call them and ask.

Quite a bit has been done with regard to automation and full PC contol. Digitrax, Lenz and NCE are the 3 most likely systems due to availability of PC interface. I would suggest you take a look at the JMRI suite of open source software at http://www.decoderpro.com/ many of the software tools to program the things you want to do are there. Digitrax has quite an array of detection and signalling products that connect to the loconet and can all be monitored/controlled by the JMRI suite. http://www.digitrax.com/menu_detectionsignaling.php Finally, if you really want to get your juices flowing with what can be done go to

http://www.thetrainshow.com:80/screening_room2.htm

look at the videos on the McKinley RR. While this is a UK prototype it has some really excellent explanation of a fantastic implementation of PC control with a Digitrax system.

USB ports use a unique user VID for identification. You would need to know that ID to ‘talk’ to the USB device.

The Lenz DCC cab bus is open and should be available for programming.

I believe the protocol is RS 485 or 486.

I would try contacting Lenz North America at

http://www.lenz.com/

Here in the US, the “big three” that have a PC interface available are Digitrax, Lenz, and NCE. There are others, but these three have the largest market share and widest support.

For complete Layout Automation, I would have to argue that Digitrax would be your best bet. It has the largest compliment of available components, both Digitrax-brand and aftermarket. Plus, it has the distinct advantages that come with LocoNet.

The Digitrax interface is into the Loconet itself and supports sending commands as well as monitoring. Since LocoNet is event-driven and not polled, and is very much like Ethernet, it is very robust. And since your computer is interfacing directly with the command buss, you have access to ALL of the system’s traffic. This could well come into play when it comes to automation. The LocoBuffer USB (available here) is a better interface device than the Digitrax MS100, sort of the same way an ethernet switch is better than a hub when it comes to collision avoidance.

NCE has a command station with an RS-232 port, but that port does NOT echo all the command buss communication. They have also announced an interface for their smaller PowerCab system, but it is still unavailable so it’s abilities remain to be seen.

Also, as you mentioned, Lenz has a USB interface, but again, I don’t believe it echos all of the command buss traffic.

All three of these interfaces, as wll as many others, are supported by JMRI so your automation could be done with Jython scripts. However, if you prefer to “roll your own”, the Loconet Personal Edition doc is available here.

HTH,

Steve

You may want to check out ZIMO/STP. A system made exactly for what you have in mind. While ZIMO supports the RS232 interface for layout control, it is much faster using its own CAN bus when using the STP software. I use this system on my own layout for more than 15 years now with 45 trains controlled by the PC and any number of trains operated manually at the same time, without informing the PC about it first. The MX1 command station manual has many pages of RS232 information if that’s the way you choose to go. You can download the manual here: http://www.mrsonline.net/html/manuals.html A ZIMO catalog is also available here: http://w3.zimo.at/web2003/pdf/ZIMO_Systempr_DCC_2006_E.pdf Regards, Art ZIMO Agency of North America www.mrsonline.net

Thanks for the info guys, good stuff. In case anyone is interested, I am drafting up plans that use a hybrid DCC / Homebrew electronics for total automation. Cheap current detectors monitoring 8-16" lengths of track for block occ, and RFID readers at various points throughout the layout (Each rolling unit will have an RFID tag in/on it somewhere. Since both of those elements will be linked to a computer via USB, all rolling stock can be automatically tracked via using a database on the computer and since the computer will have control over the DCC system, it can control the individual engines and know (approximately) where they are on the layout… well, at least the last RFID checkpoint they passed then logically assuming location by tracking the block occ signals.

With this system in place, it would be very easy to use either the DCC controllers or make my own and feed the signal into the PC. This should allow nearly perfect automatic ops with the ability to ‘take over’ any engine anywhere and the system would adapt to it.

I found these awesome little toys called phidgets (http://www.phidgetsusa.com) that allow nearly dirt cheap I/O to a computer via USB. The killer part is they offer a completely free API for writing software in VBScript, VBA, VB6, and VB.net. This means you can theoretically use something like Microsoft Access as an inventory control & tracking/layout control system. Or setup Microsoft’s free version of SQL server, script an applet and plug in your favorite wireless game controller! :slight_smile: There are enough things at the phidgets website to spark lots of ideas.

Some of the ideas I have had:

-Use 4 digital outs to simulate a DCC control bus.

-Make a computer controlled conventional DC control system by using 8 digital outs and run them through a Digital to Analog Converter (DAC), then th

No takers on that last post eh? Well thats kinda disappointing…

Anyways, I have researched the major 4 DCC manufacturers and I can say, that from a computer interface perspective, Easy DCC wins hands down. All of them are compatable with several commercial software packages out there, but only Easy DCC actually has some of the API documented for those of us who think that the existing commercial software isn’t all that great. JMRI seems like a great idea, but just isn’t getting the dev time it needs.

Does anyone have any info on programming in VB6/VBA as it pertains to linking a PC to LocoNet, eXpressNET, etc?

You may find what you need to use VB with USB port communications here:

http://www.intel.com/intelpress/usb/examples/vboverview.htm

I was a Software Developer for 42 years and had used VB for at least 10 years before retiring two years ago.

Since retiring, I only a computer user… no more programming!

The whole USB thing is more of a nice-ity as serial comms with a command station/ command cab is perfectly fine. What I am looking for is a list of commands for each of the platforms so I can make a quickie API in VBA and start coding.

After looking over some code snippets that work with the EasyDCC rs-232 connection, it almost looks as if you use telnet to issue commands:


Dim MyString As String, MyMsg As String

mdiSOCS.MSComm1.PortOpen = True ’ Open the COM port

mdiSOCS.MSComm1.InBufferCount = 0 ’ Empty the input buffer

’ Request the Version Number
Screen.MousePointer = vbHourglass ’ Set cursor to hourglass
mdiSOCS.MSComm1.Output = “V” & Chr$(13) ’ Send “V” (request version number)
WaitPort (12)
MyString = mdiSOCS.MSComm1.Input ’ Return string
Screen.MousePointer = vbDefault ’ Reset cursor to default
MyMsg = "The Command Station’s version is: "
MsgBox MyMsg & Chr$(13) & “'” & MyString & “'”, vbInformation, “Version”

mdiSOCS.MSComm1.PortOpen = False ’ Close the COM port


The bold faced line has my interest. Does one know if/where there is a set of standardiz

Not sure what you mean by JMRI “not getting the dev time it needs”. It already works with allt he systems that offer a computer interface, plus C/MRI. And NCE and Digitrax both have their ‘API’ fully documented. It also stillr emains that if you only want to run ONE control bus, Digitrax is the ONLY system that cna do this. EasyDCC, NCE, and Lenz all lack the ability for the computer interface to ‘see’ throttle activity. Best example is settign up a simple single turnout control. A stationary decoder on address 1. Dial up switch address 1 on the handheld, and operate the turnout. Build a control pnael with some computer software, JMRI or one of the commercial programs. Add a control that sends commands to switch address 1. It will work on any system, HOWEVER, ONLY with Digitrax will the computer panel change to reflect the last command even if that command was given by the handheld. With all the rest, if the computer panel is set to Normal, and a handheld changes the turnout to Reverse, the panel on the computer will still show Normal.

As for the RFID thing, this was discussed at length last yearon the ModelRailroadElectronics group on Yahoo. The general dea was that it isn’t really practical to use it as a block detection syst

There is no DCC standard for commands on the cab side of things, deliberately. Each vendor does their own thing here. Only on the track side is there standardization. I urge you again to take another look at JMRI - it’s probably more complete than many commercial programs in that they support all DCC systems that have a computer interface. In there you qwill find the methodology of talking to EasyDCC< Lenz, NCE, and Digitrax, as well as the C/MRI serial port protocol and specialized support for the SPROG standalone programmer. ANd it can communicate with more than one system at a time.

–Randy

Let me reword my statement: For many reasons, it won’t do what I need it to. Its not robust enough post-compile time. Although you do bring up a good point: all the command mappings are in there somewhere! Thanks :slight_smile:

Understood. But I will not be using DCC for anything other than Loco control. (See the USB clarification below)

[quote user=“rrinker”]

As for the RFID thing, this was discussed at length last yearon the ModelRailroadElectronics group on Yahoo. The general dea was that it isn’t really practical to use it as a block detection system - the range is too large. How would you tell which RFID tag is on track 1 and which is on track 2 when they are two parallel mains?&nbs

ZIMO will also reflect changes done by a cab on all other cabs or the PC switch board that are connected to the CAN bus, at least when used with STP software. I can’t say whether that is true using other software since the new binary interface is just now being introduced and I don’t have any experience with it yet (and I’m not a programmer [sigh]).

Have you looked at the ZIMO command station manual? There are many pages of programming information starting on page 16 for the old ASCII and the new binary interface.

Art
ZIMO Agency of North America
http://www.mrsonline.net/

Is this the type of doc you’re looking for?

http://www.digitrax.com/ftp/loconetpersonaledition.pdf

Brian Pickering

Going EASY DCC will be a fatal choice. not strong enough for other than their little things.

Our club layout which was built in my basement (I pay they run) is 100% Digitrax with JMRI software running up to 18 engines with computer control of all mainline operations PLUS the computer runs the RDC. JMRI is a very good about helping you write what you need to do something that is not done already.

Their Panel Pro is great to run the trains with. We use it with a Color CCTV system. The dispatcher sits and runs a passenger train with the CTC and the CCTV using a computer throttle. With Digitrax it is almost fool proof.

In the building of this we tried:

MRC Prodigy (still on the shelf)

Easy DCC GP9 (gave it away to the kid up the street)

We tried Digitrax for other functions but found Tony’s trains superior in all aspects with this layout. PSfoour and PSRev. We use Digitrax to run the 135 Tortoise turnouts and bicolor Leds to show the aspect on the facia.

I lone wolf the railroad a lot allowing the computer to run 3 trains when I run the peddler freight. We will be going to Digitrax signals and blocks.

[quote user=“claymore1977”]

Let me reword my statement: For many reasons, it won’t do what I need it to. Its not robust enough post-compile time. Although you do bring up a good point: all the command mappings are in there somewhere! Thanks :slight_smile:

Understood. But I will not be using DCC for anything other than Loco control. (See the USB clarification below)

[quote user=“rrinker”]

As for the RFID thing, this was discussed at length last yearon the ModelRailroadElectronics group on Yahoo. The general dea was that it isn’t really practical to use it as a block detection system - the range is too large. How would you tell which RFID tag is on track 1 and which is on track 2 when they

I too hate reinventing the wheel, but if the wheel doesn’t fit 100% correct… make a new one or mod the old one.

What I need is a VB6 for windows interface to whatever DCC system I choose. After more research down the very apparent favorite of Digitrax, I am considering the Digitrax Zephyr as a test platform. Dollar to I/O port ratio is very important to me also. I find it difficult to accept the option of buying electronics made to perform 1 or 2 functions and even then, only on a specific system, versus buying generic I/O ports for a computer and have software configured control. Cost per I/O is about 5 to 10% higher going with the generic I/O components I am considering, but the fact that I could can re-arrange, optimize or completely rework my whole layout’s electrical system with very little actual wire manipulation makes it worthwhile!

Don’t get me wrong, I am truly in awe of all the DCC systems… what an amazing accomplishment! Along the lines of re-inventing the wheel, or inventing the wheel in the first place, I was hoping to find an existing Windows VB or C++ API for interacting with systems. JMRI is java, which is incompatible with ANY of my ideas, but can be used for a data source. (Browsing the XML’s right now) Either I write an API for I/O acquisition in Java plus the database I/O plus the GUI, or I write a serial command interface for the DCC system in VB. I am opting for the latter as much more work is already done in that area.

My goal is this:

  • Centralized Computer controlled system, aka, ALL data command and data retrieval goes through the computer. This software is based on an open API that anyone could code from.
  • Use USB 2.0 as the main data path for:
    • turnout control/position reporting
    • Block Occ reporting
    • Signal light control
    • Crude Inventory location control (RFID tags)
    • Room light level reporting
    • All Accessory light control
    • Web cams for seeing hidden staging yards