JMRI Hardware Support - Connecting to a Digitrax PR4
Author: Bob Jacobsen
Keywords: Digitrax Chief DCS Command Station PR4 MS-100 LocoBuffer java model railroad JMRI install windows

# Hardware Support: Connecting to a Digitrax PR4

JMRI may be configured to use the Digitrax PR4 in a variety of ways. Exactly how the PR4 will be used depends each user's requirements. JMRI may be configured to use the PR4 to control a "Standalone Programming Track". JMRI may instead be configured to use the PR4 to give general access to the command station (including command station programming track) and LocoNet. A third option allows JMRI to interact with a "Standalone LocoNet". JMRI does not prefer any one method method over any other method. You may even set up multiple JMRI "configuration profiles", each with a different PR4 mode; you choose which one to use whenever you start JMRI. Which PR4 mode(s) you use depends on your needs. The table below summarizes these methods.

Usage | Settings in JMRI Connection Profile | Available JMRI Capabilities
--- | --- | ---
System Connection | JMRI Command Station Type
Decoder Programming on PR4 Programming Track | "PR4" | "PR4 Standalone Programmer" | Program decoder CVs on the PR4's dedicated programming track
Operate one loco on the dedicated programming track
LocoNet Interface, Decoder Programming | "PR4" | "(a command station)" | Program decoder CVs on the dedicated programming track and/or the main track
Control one or more locos on the main track
Control and monitor LocoNet-connected Switches, Sensors, and Transponding
Configure some LocoNet devices
Control or monitor the LocoNet Fast Clock
Update firmware on some LocoNet devices
etc.
Standalone LocoNet | "PR4" | "Standalone LocoNet"
Control and monitor LocoNet-connected Switches, Sensors, and Transponding
Configure some LocoNet devices
Control or monitor the LocoNet Fast Clock
Update firmware on some LocoNet devices
etc.

## Choosing the PR4 operating mode

When setting up a JMRI "connection profile" for a PR4, which "command station" should you use when configuring JMRI? That depends on what you intend to do with JMRI.

- If you will only use JMRI to program decoders on the PR4 dedicated programming track, then configure the connection for the "command station" type of "PR4 Standalone Programmer". In this mode, JMRI will be able to read and write decoder CV values for decoders on the PR4 dedicated programming track. In this mode, you may also use a JMRI throttle to select and control the locomotive on the dedicated programming track, subject to the ability of the PR4 to supply sufficient current to the decoder. JMRI will not be able to access the command station or LocoNet peripherals, and JMRI throttles will not be able to control decoders via the "main track".
- If you wish JMRI to be able to control decoders via the command station's programming track and/or main track outputs, and access LocoNet devices, then configuring the connection for the "command station" type suitable for your command station is appropriate. In this mode, JMRI is able to control decoders connected via the main track outputs and access LocoNet devices and the command station's programming track. JMRI throttles will not be able to run decoders which are on the command station's dedicated programming track outputs.
- If you wish to use the PR4 to provide an interface to a LocoNet which does not have a command station, then select "Standalone LocoNet" as the "command station" type.
- If you think that several modes may be useful to you, you should consider setting up one configuration profile for each of the useful modes. Then, when you start JMRI, you may select the configuration profile which suits the way you want to use JMRI. And to switch to the other mode, you may simply quit JMRI and re-start it, and select the another profile, so that you may perform some other type of work.

## PR4 as a stand-alone decoder programmer

When the PR4 is configured to act as a programmer, it is connected to a dedicated programming track via the screw terminals on the PR4. A separate power supply, such as the PS14, must be used with the PR4 in this case. When JMRI is properly configured, JMRI can use the PR4 programming track to set CVs in any decoder that DecoderPro supports.

This mode of operation can also be used to download sound information into Digitrax sound decoders and, within its limited current capability, run one locomotive to test it. When used with Digitrax SFX decoders, "neutral mode" allows you to vary the speed without the motor moving the decoder, so you can hear how the locomotive sound reacts to varying speeds.

Note that Digitrax only guarantees programming for Digitrax SFX decoders with properly installed loads, etc, but our testing has found that the PR4 will work with many common decoders.

When configured as a standalone programmer, the PR4 is not able to communicate with the command station or any LocoNet peripherals. The red "X" in the diagram above denotes this limitation.

To set up JMRI to use the PR4 via the dedicated decoder programming track mode:

- Start the program.
- Open the Preferences window from the Edit menu and configure the connection by:
  - For the "System Connection" setting, select "LocoNet PR4"
  - Under "Serial Port", select the serial port that's connected to the PR4
  - In the "Command station type" option, select "PR4 standalone programmer".
  - In the advanced settings, the speed will be fixed at 57,600 baud.
  - In the advanced settings, the "Flow Control" option defaults to "Use Hardware Flow Control", which is the preferred setting for the PR4. You should try that first, as it is the most reliable mode. Only if you can't reliably program decoders using that choice, and only after checking that you're using the right port, should you select "None" for this preference and try again.
- Click Save at the bottom of the preferences window, quit the program and restart.

The "connection" preferences should look similar to this image:

### PR4 Standalone programmer usage suggestions

You can use a JMRI throttle to control the locomotive connected to the PR4 dedicated programming track. Use the JMRI Power Control or the "Power" menu item on the Throttle's menu bar to turn on track power, and then you can operate the locomotive normally.

The PR4 can only provide very limited current to its programming track, so Digitrax has built a "neutral mode" into their sound decoders. When JMRI and the PR4 is running a Digitrax sound decoder, the motor is disconnected to reduce the current load. You can still ramp the speed up and down with the throttle and listen to how the sound responds, but the motor won't move the locomotive.

- To implement that "neutral mode" described above, the PR4 automatically writes CV128 to 0 or 1. This happens when a JMRI throttle is used to run the locomotive on the PR4 programming track, and there's nothing JMRI can do to prevent it. Unfortunately, this can interfere with the CV programming on some non-Digitrax decoders. For example, it will set the "Master Volume" CV128 on some SoundTraxx decoders to a very low volume.
- If you are using the PR4 with a decoder that uses CV128 for something, you should either not use a JMRI throttle to run the locomotive on the PR4 programming track, or remember to rewrite CV128 with the right value just before removing the locomotive from the track.

Other decoders, including decoders from other manufacturers, may draw enough motor current to trip the PR4 internal circuit breakers. This will cause JMRI to mark track power as "off". Just wait a couple seconds and turn the track power back on to recover.

## PR4 as a LocoNet Interface

When acting as a LocoNet interface, the PR4 allows JMRI to interact with devices connected to LocoNet. This includes programming decoders on a programming track attached to a LocoNet command station. Where the LocoNet command station supports "programming on the main", JMRI is able to make use of that feature.

To set up JMRI to use the PR4 via the dedicated decoder programming track mode:

- Start the program.
- Open the Preferences window from the Edit menu and configure the connection by:
  - For the "System Connection" setting, select "LocoNet PR4"
  - Under "Serial Port", select the serial port that's connected to the PR4
  - In the "Command station type" option, select the command station model which you are using.
  - In the advanced settings, the speed will be fixed at 57,600 baud.
  - In the advanced settings, the "Flow Control" option defaults to "Use Hardware Flow Control", which is the preferred setting for the PR4. You should try that first, as it is the most reliable mode. Only if you can't reliably program decoders using that choice, and only after checking that you're using the right port, should you select "None" for this preference and try again.
- Click Save at the bottom of the preferences window, quit the program and restart.

The "connection" preferences should look similar to this image:

## PR4 as an interface to a Standalone LocoNet

The PR4 can also be used to connect JMRI to a "Standalone LocoNet", which may be useful when LocoNet is used for some aspects of layout control while some other control system is use for other aspects. An example may be track occupancy detection and signaling using Digitrax BDL168 and SE8C boards while locomotive control is provided by a non-LocoNet DCC system. More information on this advanced topic is available on the Standalone LocoNet page.

Note that the PR4 is unable to provide either RailSync power or LocoNet data signal termination to the Standalone LocoNet. This is a significant departure from the PR3 design. If you replace a PR3 with a PR4 in a Standalone LocoNet application, you will need to provide some other source of RailSync power and LocoNet data termination the Standalone LocoNet page for more details.

To set up JMRI to use the PR4 to connect to a Standalone LocoNet:

- Start the program.
- Open the Preferences window from the Edit menu and configure the connection by:
  - For the "System Connection" setting, select "LocoNet PR4"
  - Under "Serial Port", select the serial port that's connected to the PR4
  - In the "Command station type" option, select "Stand-alone LocoNet".
  - In the advanced settings, the speed will be fixed at 57,600 baud.
  - In the advanced settings, the "Flow Control" option defaults to "Use Hardware Flow Control", which is the preferred setting for the PR4. You should try that first, as it is the most reliable mode. Only if you can't reliably program decoders using that choice, and only after checking that you're using the right port, should you select "None" for this preference and try again.
- Click Save at the bottom of the preferences window, quit the program and restart.

# PR4 Drivers

The PR4 needs to have a driver installed when used with any Microsoft Windows Operating System. See the PR4 support articles at the web links for the PR4. Make sure to follow the instructions exactly, particularly about the order of installing the drivers and plugging in the device. Note that the PR4 makes use of the PR3 drivers.

Digitrax makes its drivers available on its web site on the Downloads page.

You don't need to install a separate driver when using current versions of Mac OS X or Linux.

# See Also

- JMRI's general Digitrax support page
- The JMRI "Standalone LocoNet" page.
- For more information on the PR4 itself, please consult the Digitrax web site:
  - The Digitrax PR4 product page.
  - The Digitrax PR4 Support page.
  - Drivers for Windows-based machines may be found at the Digitrax Downloads page. Note: use the Digitrax PR3 drivers with the PR4.

LocoNet® is a registered trademark of Digitrax, Inc.