Class XNetTurnout

All Implemented Interfaces:
PropertyChangeListener, Comparable<NamedBean>, EventListener, PropertyChangeProvider, DigitalIO, AbstractMRListener, XNetListener, NamedBean, Turnout
Direct Known Subclasses:
EliteXNetTurnout, Z21XNetTurnout, ZTC611XNetTurnout

public class XNetTurnout
extends AbstractTurnout
implements XNetListener
Extend jmri.AbstractTurnout for XNet layouts

Turnout operation on XpressNet based systems goes through the following sequence:

  • set the commanded state, and, Send request to command station to start sending DCC operations packet to track
  • Wait for response message from command station. (valid response list follows)
  • Send request to command station to stop sending DCC operations packet to track
  • Wait for response from command station
    • If Success Message, set Known State to Commanded State
    • If error message, repeat previous step

NOTE: Some XpressNet Command stations take no action when the message generated during the third step is received.

Valid response messages are command station dependent, but there are 4 possibilities:

  • a "Command Successfully Received..." (aka "OK") message
  • a "Feedback Response Message" indicating the message is for a turnout with feedback
  • a "Feedback Response Message" indicating the message is for a turnout without feedback
  • The XpressNet protocol allows for no response.

Response NOTE 1: The "Command Successfully Received..." message is generated by the lenz LIxxx interfaces when it successfully transfers the command to the command station. When this happens, the command station generates no useable response message.

Response NOTE 2: Currently the only command stations known to generate Feedback response messages are the Lenz LZ100 and LZV100.

Response NOTE 3: Software version 3.2 and above LZ100 and LZV100 may send either a Feedback response or no response at all. All other known command stations generate no response.

Response NOTE 4: The Feedback response messages may be generated asynchronously

Response NOTE 5: Feedback response messages may contain feedback for more than one device. The devices included in the response may or may not be stationary decoders (they can also be feedback encoders see XNetSensor).

Response NOTE 6: The last situation situation is not currently handled. The supported interfaces garantee at least an "OK" message will be sent to the computer

What is done with each of the response messages depends on which feedback mode is in use. "DIRECT,"MONITORING", and "EXACT" feedback mode are supported directly by this class.

"DIRECT" mode instantly triggers step 3 when any valid response message for this turnout is received from the command station or computer interface.

"SIGNAL" mode is identical to "DIRECT" mode, except it skips step 2. i.e. it triggers step 3 without receiving any reply from the command station.

"MONITORING" mode is an extention to direct mode. In monitoring mode, a feedback response message (for a turnout with or without feedback) is interpreted to set the known state of the turnout based on information provided by the command station.

"MONITORING" mode will interpret the feedback response messages when they are generated by external sources (fascia controls or other XpressNet devices) and that information is received by the computer.

"EXACT" mode is an extention of "MONITORING" mode. In addition to interpretting all feedback messages from the command station, "EXACT" mode will monitor the "motion complete" bit of the feedback response.

For turnouts without feedback, the motion complete bit is always set, so "EXACT" mode handles these messages as though the specified feedback mode is "MONITORING" mode.

For turnouts with feedback, "EXACT" mode polls the command station until the motion complete bit is set before triggering step 3 of the turnout operation sequence.

"EXACT" mode will interpret the feedback response messages when they are generated by external sources (fascia controls or other XpressNet devices) and that information is received by the computer.

NOTE: For LZ100 and LZV100 command stations prior to version 3.2, it may be necessary to poll for the feedback response data.