Class NceTurnoutMonitor

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener, AbstractMRListener, NceListener

    public class NceTurnoutMonitor
    extends java.lang.Object
    implements NceListener, java.beans.PropertyChangeListener
    Polls NCE Command Station for turnout discrepancies

    This implementation reads the NCE Command Station (CS) memory that stores the state of all accessories thrown by cabs or through the com port using the new binary switch command. The accessory states are stored in 256 byte array starting at address 0xEC00 (PH5 0x5400).

    byte 0, bit 0 = ACCY 1, bit 1 = ACCY 2 byte 1, bit 0 = ACCY 9, bit 1 = ACCY 10

    byte 255, bit 0 = ACCY 2041, bit 3 = ACCY 2044 (last valid addr)

    ACCY bit = 0 turnout thrown, 1 = turnout closed

    Block reads (16 bytes) of the NCE CS memory are performed to minimize impact to the NCE CS. Data from the CS is then compared to the JMRI turnout (accessory) state and if a discrepancy is discovered, the JMRI turnout state is modified to match the CS.