Interfacing with controllers

The interface to the controllers is based on sending a message to be processed by a message processor of the controller type.

The messages passed to the message processor contain only the information in order to complete an action.  This information is in an internal data format.  Each message processor then processes the information into packets of data to be sent to the controller over the interface device of the controller.

If there is any data to be sent back from the controller the data is read by the processor, processed and returned in an internal format.

Using this process the implementation is contained only withing the controller implementation of the message processor.

For example the steps to read a CV from a decoder using program track mode would be completed using the following steps:

  1. Send the message processor a “Enter Program Mode” message.
  2. Send the message processor a “Read CV” message requesting the CV number.
  3. The “Read CV” message returns the value contain in the decoders CV.
  4. Repeating the steps for each CV to be read.
  5. Send the message processor a “Exit Program Mode” message.

In a similar manner messages are sent to the message processor to set the speed and direction of locos, set decoder functions on or off or setting accessories etc.

Leave a Reply