desktop_station_s_serial_communication_specification
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン次のリビジョン両方とも次のリビジョン | ||
desktop_station_s_serial_communication_specification [2015/02/20 05:55] – yaasan | desktop_station_s_serial_communication_specification [2017/02/05 13:48] – yaasan | ||
---|---|---|---|
行 1: | 行 1: | ||
====== Serial Communication Specification ====== | ====== Serial Communication Specification ====== | ||
+ | |||
+ | ===== How to use this topic ===== | ||
+ | |||
+ | This topic describes in Desktop Station' | ||
+ | |||
+ | このページでは、Windows上で動作するDesktop Station Softwareと、DSmainR5や、DCC/ | ||
===== How to communicate ===== | ===== How to communicate ===== | ||
- | The following table describes serial communication configuration. | + | The following table describes serial communication configuration. |
+ | シリアル通信設定は以下のとおりです。 | ||
|Parity | None | | | |Parity | None | | | ||
行 10: | 行 17: | ||
|Bit rate | 115200bps (Default) | It depends on the configuration of Arduino' | |Bit rate | 115200bps (Default) | It depends on the configuration of Arduino' | ||
+ | Command structure is " | ||
+ | The parameter numeric must use decimal number. Do not use hexadecimal at command message.\\ | ||
Desktop Station sends to Arduino with DSmain or DCC/MM2 shield | Desktop Station sends to Arduino with DSmain or DCC/MM2 shield | ||
+ | コマンドの構造は、「コマンド名(引数1, | ||
===== Command list ===== | ===== Command list ===== | ||
^Commands ^ Parameters ^ examples ^ | ^Commands ^ Parameters ^ examples ^ | ||
- | |setLocoDirection| Locomotive address, Locomotive Direction | setLocoDirection(5, | ||
- | |setLocoFunction| Locomotive address, Function No, Function On/Off| setLocoFunction(5, | ||
- | |setTurnout| Accessory address, Turnout Direction | setLocoDirection(5, | ||
|setPower| Power on/off | setPower(1)\n| | |setPower| Power on/off | setPower(1)\n| | ||
|setLocoSpeed| Locomotive address, Speed, (Speed Step)| setLocoSpeed(5, | |setLocoSpeed| Locomotive address, Speed, (Speed Step)| setLocoSpeed(5, | ||
+ | |setLocoDirection| Locomotive address, Locomotive Direction | setLocoDirection(5, | ||
+ | |setLocoFunction| Locomotive address, Function No, Function On/Off| setLocoFunction(5, | ||
+ | |setTurnout| Accessory address, Turnout Direction | setTurnout(5, | ||
|getS88| S88 decoder count | getS88(2)\n | | |getS88| S88 decoder count | getS88(2)\n | | ||
- | |setLocoConfig| | + | |setLocoConfig| |
+ | |getLocoConfig| CV Address, CV No | getLocoConfig(49152, | ||
===== Parameter meaning ===== | ===== Parameter meaning ===== | ||
行 28: | 行 38: | ||
^Parameter ^ Value range ^ meanings ^ | ^Parameter ^ Value range ^ meanings ^ | ||
|Power on/off | 0-1 | 0: Power Off, 1: Power On | | |Power on/off | 0-1 | 0: Power Off, 1: Power On | | ||
- | |Locomotive address | 0-65535 | See [[DSCore]] | + | |Locomotive address | 0-65535 | See the following |
|Speed | 0-1023 | 1023 means max speed. 0 means stop locomotive. | | |Speed | 0-1023 | 1023 means max speed. 0 means stop locomotive. | | ||
|Speed step | 0-2 | 0: DCC28 or MM2 14, 1:DCC14, 2:DCC128 | | |Speed step | 0-2 | 0: DCC28 or MM2 14, 1:DCC14, 2:DCC128 | | ||
行 34: | 行 44: | ||
|Function Value | 0-1| Locomotive' | |Function Value | 0-1| Locomotive' | ||
|Locomotive Direction | 1-2 | 1:FWD, 2:REV | | |Locomotive Direction | 1-2 | 1:FWD, 2:REV | | ||
- | |Accessory address | 0-1024| DCC:1-1024, MM2: 1-320| | + | |Accessory address | 0-65535 | See the following address description.| |
- | |Accessory | + | |Turnout/ |
|S88 decoder count | 0-32 | Set connected S88 decoder count.| | |S88 decoder count | 0-32 | Set connected S88 decoder count.| | ||
- | |dammy | 0 | Set 0.| | + | |CV Address| 0 or 49152 | Set 0 (MM2, under developing) or 49152 (DCC).| |
- | |CV No | 0-255 | Locomotive' | + | |CV No | 0-1023| Locomotive' |
|CV Value | 0-255 | Locomotive' | |CV Value | 0-255 | Locomotive' | ||
+ | |||
+ | The following table describes Locomotive' | ||
+ | |||
+ | ^Address type ^Address range ^Address means ^Notes | ||
+ | |Marklin Motorola 2 locomotive | 0x0000-0x07FF | 0(0x0000) - 255(0x00FF) | | | ||
+ | |DCC locomotive | 0xC000-0x1FFF | 0(0xC000) - 9999(0xE70F) | | | ||
+ | |Marklin Motorola 2 accessory | 0x3000-0x37FF | 1(0x3000) - 320(0x3140) | | | ||
+ | |DCC accessory | 0x3800-0x3FFF | 1(0x3800) - 2044(0x3FFC) | | | ||
+ | |||
+ | ===== Reply message ===== | ||
+ | |||
+ | ^Reply message ^ meanings ^ | ||
+ | |100 Ready | Waiting for commands. | | ||
+ | |200 Ok | Completely processed. Received correctly. | | ||
+ | |300 Command error | Command or Parameter is not correct. | | ||
+ | |301 Syntax error | Command is not parsed correctly. Command syntax is not correct. | | ||
+ | |302 receive timeout | Command is not received fully in the enough time. | | ||
+ | |303 Unknown error | Unknown issue happens. | | ||
+ | |||
+ | ===== Communication procedure ===== | ||
+ | |||
+ | - Initialization of serial port. | ||
+ | - Set baudrate 115200bps and FIFO configuration(if needed). | ||
+ | - Open serial port | ||
+ | - Reset serial port(Use DTR). | ||
+ | - Wait for receiving a message "100 Ready" | ||
+ | - After received "100 ready", | ||
+ | |||
+ | |||
+ | ===== Example of communication log ===== | ||
+ | |||
+ | < | ||
+ | [RECV]100 Ready | ||
+ | [SEND] setPing() | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setPower(1) | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoSpeed(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoSpeed(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoSpeed(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoSpeed(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoFunction(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] getS88(1) | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoFunction(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] getS88(1) | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoDirection(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoSpeed(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoSpeed(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoSpeed(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setLocoSpeed(3, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setTurnout(12288, | ||
+ | [RECV]200 Ok | ||
+ | [SEND] setTurnout(12290, | ||
+ | [RECV]200 Ok | ||
+ | </ |
desktop_station_s_serial_communication_specification.txt · 最終更新: 2023/12/26 21:00 by yaasan