Indexed DCC++ Output Pin Control for Turnouts

Rob H Jan 2, 2018

  1. Rob H

    Rob H TrainBoard Member

    22
    15
    2
    Having got my DCC++ base station up and running with both JMRI & WiThrottle and programmed up my decoder chips, the next step is to figure out a way to control my turn outs. The obvious (to me) option is to use some of the additional pins on my Mega (22-53) to drive a relay board to actuate solinoid motors rather than having to use decoders as for now at least I'm only looking to have 8 turnouts. Whilst looking at how to implement this I came across the following: jmri.sourceforge.net/help/en/html/hardware/dccpp/Turnouts.shtml and option 3 (Indexed DCC++ Output Pin Control) appears in therory to do exactly what I want. However despite bashing my head against the wall for most of the day I'm no closer to getting it to work, so I was wondering has anyone tried this method and are there any gotchas I need to look out for?

    Thanks
     
    Scott Eric Catalano likes this.
  2. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    JMRI and DCC++ outputs is a bit of a mess really, they have modeled outputs, turnouts and sensors as the same base type in JMRI and it is unnecessarily complex!

    You can define the outputs yourself by connecting to the base station and sending commands like:
    Code:
    <Z 22 22 0>
    <Z 23 23 0>
    ...
    <Z 53 53 0>
    
    This creates the indexed outputs on the pins 22-53 using output IDs matching the pin numbers and a default state of ACTIVE HIGH and default to last known state (starting state if LOW).

    After you issue these commands you can then reconnect JMRI to the base station and it should pick up the outputs and allow you to interact with them within JMRI.
     
    Scott Eric Catalano likes this.
  3. Rob H

    Rob H TrainBoard Member

    22
    15
    2
    Thanks, that's helped, I managed to define my turnouts and control them from JMRI but I lost everything when I powered off so I need to figure out what I did wrong, but atleast I'm making progress in the right direction.
     
    Scott Eric Catalano likes this.
  4. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    After you configure everything in JMRI make sure you send "<E>" to store the configuration settings.
     
    Scott Eric Catalano and Rob H like this.
  5. Rob H

    Rob H TrainBoard Member

    22
    15
    2
    Thanks, I'll give that a go later, just put everything away, figured having a break from it would help me think.
     
    Scott Eric Catalano and Atani like this.
  6. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Further to Atani's suggestion above, here's what I do:

    Create a notepad (or similar) text document, and type in the command settings that you need, EG:

    <T1 1 0><T2 1 1> <T3 1 2><T4 1 3><E>
    <S0 0 0><S1 1 0><S2 2 0><S3 3 0><S4 4 0><S5 5 0><E>
    And then save the text document.


    Then if you ever need to restore them into the DCC++ Basestation, simply start a serial terminal, open the text document and copy and paste each complete line in turn to the serial terminal eg;
    <T1 1 0><T2 1 1> <T3 1 2><T4 1 3><E>
    This example will set up my 4 turnout settings and save them all in one hit.

    Jim
     
    Last edited: Jan 7, 2018
    Scott Eric Catalano, Atani and Rob H like this.

Share This Page