Scale-N

Scale-N
Arduino
Componenten
Rollend Materieel
Naslag
Onderdelen
Wissels
Basis Electronica
Symbols Electronica
Programming Arduino
DCC++
DR5000
Products
Link













































STATIONARY ACCESSORY DECODERS & TURNOUTS

DCC++ BASE STATION can keep track of the direction of any turnout that is controlled by a DCC stationary accessory decoder once its Defined (Set Up).
All decoders that are not in a engine are accessory decoders including turnouts.
Besides being defined all turnouts, as well as any other DCC accessories connected in this fashion, can always be operated using the DCC BASE STATION Accessory command:
You Controlling a Accessory Decoder** with **< a ADDRESS SUBADDRESS ACTIVATE >
<: Begin DCC++ command
a (lower case a) this command is for a Acessory Decoder
ADDRESS: the primary address of the decoder controlling this turnout (0-511)
SUBADDRESS: the subaddress of the decoder controlling this turnout (0-3)
ACTIVATE: (0) (Deactivate, Off, Unthrown) or (1) (Activate, On, Thrown)
>: End DCC++ command

However, this general command simply sends the appropriate DCC instruction packet to the main tracks to operate connected accessories. It does not store or retain any information regarding the current status of that accessory.


Defining (Setting up) a Turnout

To have the DCC++ BaseStation store and retain the direction of DCC-connected turnouts, as well as automatically invoke the required < a > command as needed, first define/edit/delete such turnouts using the following variations of the "T" command:

Command to define a Turnout: < T ID ADDRESS SUBADDRESS >:
Creates a new turnout ID, with specified ADDRESS and SUBADDRESS if turnout ID already exists, it is updated (over written) with the new specified ADDRESS and SUBADDRESS
Returns: < O > if successful and < X > if unsuccessful (e.g. out of memory)
Command to Delete a turnout < T ID >:
Deletes the definition of a turnout with this ID
Returns: < O > if successful and < X > if unsuccessful (e.g. ID does not exist)
Command to List all defined turnouts: < T >:
Lists all defined turnouts.
Returns: < H ID ADDRESS SUBADDRESS THROW > for each defined turnout or < X > if no turnouts have beed defined or saved.
ID: The numeric ID (0-32767) of the turnout to control.
(You pick the ID & They ares shared between Turnouts, Sensors and Outputs)
ADDRESS: the primary address of the decoder controlling this turnout (0-511)
SUBADDRESS: the subaddress of the decoder controlling this turnout (0-3)

Once all turnouts have been properly defined, Use the < E > command to store their definitions to EEPROM.
If you later make edits/additions/deletions to the turnout definitions, you must invoke the < E > command if you want those new definitions updated in the EEPROM.
You can also ERASE everything (turnouts, sensors, and outputs) stored in the EEPROM by invoking the < e > (lower case e) command.
(There is no Un-Delete)

Example: You have a turnout on your main line going to warehouse industry. The turnout is controlled by a accessory decoder with a address of 123 and is wired to output 3. You want it to have the ID of 10. You would send the following command to the DCC++ BaseStation
< T 10 123 3 >

This Command means:
<: Begin DCC++ command
T: (Upper case T) Define a Turnout
10: ID number I am setting to use this turnout
123: The accessory decoders address
3: The turnout is wired to output 3
 : End DCC++ command
 DCC++ should return < O > Meaning Command Sucessful
 Next you would send the following command to the DCC++ BaseStation
 < E >

This Command means:
<: Begin DCC++ command
E: (Upper case E) Store (save) this definition to EEPROM
 : End DCC++ command
 DCC++ should return < O > Meaning Command Successful


Controlling a Defined Turnout

Sets turnout ID to either the "thrown"(turned) or "unthrown"(straight) position
The Turnout format is < T ID THROW >
ID: The numeric ID (0-32767) That you gave the turnout to control when you defined it.
THROW: 0 (unthrown) or 1 (thrown)
Returns: < H ID THROW > or < X > if turnout ID does not exist

Example Continued from above:
To throw turnout 10 so a engine can go to the warehouse siding you would send the following command.
< T 10 1 >

This Command means:
<: Begin DCC++ command
T: (Upper case T) Throw a turnout.
10: ID number of the defined turnout I want to control.
1: Set turnout to Thrown (turned, on) position.
: End DCC++ command
DCC++ should return < H 10 1 > Meaning Command Throw turnout 10 was Successful NOTE: This return may list all turnouts and thier directions