desktop_station_s_serial_communication_specification
文書の過去の版を表示しています。
目次
Serial Communication Specification
How to use this topic
This topic describes in Desktop Station's serial communication specification. DSGatewayLib's example (e.g. DSgateway, DSmainRx) supports this specification to communicate with Desktop Station.
How to communicate
The following table describes serial communication configuration.
Parity | None | |
Data Bits | 8 | |
Stop Bit | 1 | |
Bit rate | 115200bps (Default) | It depends on the configuration of Arduino's sketch |
Desktop Station sends to Arduino with DSmain or DCC/MM2 shield that the end of command text is as line feed code “\n (0x0A)”.
Command list
Commands | Parameters | examples |
---|---|---|
setPower | Power on/off | setPower(1)\n |
setLocoSpeed | Locomotive address, Speed, (Speed Step) | setLocoSpeed(5,100,2)\n |
setLocoDirection | Locomotive address, Locomotive Direction | setLocoDirection(5,1)\n |
setLocoFunction | Locomotive address, Function No, Function On/Off | setLocoFunction(5,1,1)\n |
setTurnout | Accessory address, Turnout Direction | setTurnout(5,1)\n |
getS88 | S88 decoder count | getS88(2)\n |
setLocoConfig | dammy, CV No, CV Value | setLocoConfig(0,1,3)\n |
Parameter meaning
Parameter | Value range | meanings |
---|---|---|
Power on/off | 0-1 | 0: Power Off, 1: Power On |
Locomotive address | 0-65535 | See DSCore specification address description. |
Speed | 0-1023 | 1023 means max speed. 0 means stop locomotive. |
Speed step | 0-2 | 0: DCC28 or MM2 14, 1:DCC14, 2:DCC128 |
Function No | 0-28 | Locomotive's function number |
Function Value | 0-1 | Locomotive's function ON(1) or OFF(0) |
Locomotive Direction | 1-2 | 1:FWD, 2:REV |
Accessory address | 0-1024 | DCC:1-1024, MM2: 1-320 |
Turnout Direction | 0-1 | 1:Straight, 0: diverging |
S88 decoder count | 0-32 | Set connected S88 decoder count. |
dammy | 0 | Set 0. |
CV No | 0-255 | Locomotive's CV number |
CV Value | 0-255 | Locomotive's CV Value |
desktop_station_s_serial_communication_specification.1424379506.txt.gz · 最終更新: 2015/02/20 05:58 by yaasan