<T [«id»] [«various parameters»]>
<J T [«id»]>
Define or manage Turnouts/Points¶
Serial commands to define or manage Turnouts/Points.
Commands¶
Defining and deleting Turnouts/Points¶
<T «id» DCC «addr» «subadd»>Create DCC turnout/point<T «id» DCC «»>Create DCC turnout/point<T «id» SERVO «vpin» «closedValue» «thrownValue» «profile»>Create Servo turnout/point<T «id» VPIN «vpin»>Create pin turnout/point<T «id»>Delete turnout/point
Managing Turnouts/Points¶
<T>List all turnouts/points. Equivalent to<J T><J T>List all turnouts/points. Equivalent to<T><T «id» X>List turnout/point details. Equivalent to<J T «id»><J T «id»>List turnout/point details. Equivalent to<T «id» X><T «id» «state»>Throw/Close turnout/point
Parameters¶
- id: id of the Turnout/Point to define or manage (
0-32767) - addr: Address. Ranges from
0to511 - subAddr: Sub-address. Ranges from
0to3 - linearAddr: ranges from
1(address 1/subaddress 0) to2044(address 511/subaddress 3). - vpin: Vpin to which the servo is attached
- closedValue: the PWM value corresponding to the servo position for CLOSED state, normally in the range
102to490 - thrownValue: the PWM value corresponding to the servo position for THROWN state, normally in the range
102to490 - state - one of:
1= ThrowT= Throw (not seen in responses)0= CloseC= Close (not seen in responses)X= eXamine. Equivalent to using<J T «id»>
- Profile - one of:
InstantFastMediumSlowBounce
Response¶
The following are not a direct response, but rather a broadcast that will be triggered as a result of any track manager changes.
Response for <T «id» ...>¶
For the following commands:
<T «id» DCC «addr» «subaddr»><T «id» DCC «»><T «id» SERVO «vpin» «closedValue» «thrownValue» «profile»><T «id» VPIN «vpin»><T «id»>
The response will be:
- (successful):
<O> - (fail):
<X>
Response for <T> and <J T>¶
the response/broadcast is:
Repeated for each defined Turnout/Point:
- (successful):
<H «id» «state»> - (fail): N/A
- (no defined turnouts/points):
X- id - The numeric ID (0-32767) of the turnout/point to control.
- state: one of
- 1 = Thrown,
- 0 = Closed
Response for <T «id» X> and <J T «id»>¶
the response/broadcast is:
- (DCC Accessories):
<H «id» DCC «addr» «subaddr» «state»> - (Servos):
<H «id» SERVO «vpin» «thrownValue» «closedValue» «profile» «state»> - (VPIN):
<H «id» VPIN «vpin» «state»> - (LCN):
<H «id» LCN «state»> - (fail/no such turnout/point):
<X>- id: The numeric ID (0-32767) of the turnout/point to control.
- profile - one of:
0= Instant1= Fast (0.5 sec)2= Medium (1 sec)3= Slow (2 sec)4= Bounce (subject to revision)
- state - one of:
1= Thrown0= Closed
- (fail):
<X>
Response for <T «id» «state»>¶
the response/broadcast is:
- (successful):
<H «id» «state»>- id: The numeric ID (0-32767) of the turnout/point to control.
- state - one of:
1= Thrown0= Closed
- (fail):
<X>
Response for <T «id»>¶
the response/broadcast is:
The response will be:
- (successful):
<O> - (fail):
<X>(Id does not exist)- id: The numeric ID (0-32767) of the turnout/point to control.
Notes¶
- Servos are not supported on the minimal HAL (Uno or Nano target).
- The active and inactive positions are defined in terms of the PWM parameter (0-4095 corresponds to 0-100% PWM). The limits for an SG90 servo are about 102 to 490. The standard range of 1ms to 2ms pulses correspond to values 205 to 409. Profile defines the speed and style of movement: 0=Instant, 1=Fast (0.5 sec), 2=Medium (1 sec), 3=Slow (2 sec) and 4=Bounce (subject to revision).
- vpin is the pin number of the output to be controlled by the turnout/point object.
For Arduino output pins, this is the same as the digital pin number. For servo outputs and I/O expanders, it is the pin number defined for the HAL device (if present), for example 100-115 for servos attached to the first PCA9685 Servo Controller module, 116-131 for the second PCA9685 module, 164-179 for pins on the first MCP23017 GPIO expander module, and 180-195 for the second MCP23017 module. <T «id» «vpin «closedValue» «thrownValue>is a depricated version of the command. It is not documented here.<T «id» «addr» «subadd»>is a depricated version of the command. It is not documented here.
Examples¶
Example Commands¶
-
Example:
<T 23 DCC 5 0>Example: You have a turnout/point on your main line going to warehouse industry. The turnout/point is controlled by an 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 CommandStation:
<T 10 DCC 123 3>This Command means:
- T = (Upper case T) Define a turnout/point
- DCC = The turnout/point is DCC Accessory Decoder based
- 10 = ID number I am setting to use this turnout/point
- 123 = The accessory decoders address
- 3 = The turnout/point is wired to output 3
-
Example:
<T 23 DCC 44>(corresponds to address 11 subaddress 3) - Example:
<T 25 VPIN 30>defines a turnout/point that operates Arduino digital output pin D30. - Example:
<T 26 VPIN 164>defines a turnout/point that operates the first pin on the first MCP23017 GPIO expander (if present).
Example Responses¶
- TODO LOW - Example Responses