desktop_station_s_serial_communication_specification
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン次のリビジョン両方とも次のリビジョン | ||
desktop_station_s_serial_communication_specification [2016/04/30 07:22] – [Parameter meaning] yaasan | desktop_station_s_serial_communication_specification [2017/06/05 06:25] – [Example of communication log] yaasan | ||
---|---|---|---|
行 25: | 行 25: | ||
^Commands ^ Parameters ^ examples ^ | ^Commands ^ Parameters ^ examples ^ | ||
+ | |setPing| none | setPing()\n| | ||
|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, | ||
行 32: | 行 33: | ||
|getS88| S88 decoder count | getS88(2)\n | | |getS88| S88 decoder count | getS88(2)\n | | ||
|setLocoConfig| CV Address, CV No, CV Value | setLocoConfig(49152, | |setLocoConfig| CV Address, CV No, CV Value | setLocoConfig(49152, | ||
+ | |getLocoConfig| CV Address, CV No | getLocoConfig(49152, | ||
===== Parameter meaning ===== | ===== Parameter meaning ===== | ||
行 47: | 行 49: | ||
|S88 decoder count | 0-32 | Set connected S88 decoder count.| | |S88 decoder count | 0-32 | Set connected S88 decoder count.| | ||
|CV Address| 0 or 49152 | Set 0 (MM2, under developing) or 49152 (DCC).| | |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' | ||
行 67: | 行 69: | ||
|302 receive timeout | Command is not received fully in the enough time. | | |302 receive timeout | Command is not received fully in the enough time. | | ||
|303 Unknown error | Unknown issue happens. | | |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", | ||
+ | - Firstly you need to send " | ||
+ | - The output of track is available. Send commands which you want. | ||
===== Example of communication log ===== | ===== Example of communication log ===== | ||
+ | |||
+ | 以下は、通信ログの例です。setPing()を投げて生存確認をしてから、setPower(1)で線路電源のON、そのあとはコマンドを打てばその通りにDCC信号が出力されます。 | ||
< | < | ||
- | [RECV]200 Ok | + | [RECV]100 Ready |
[SEND] setPing() | [SEND] setPing() | ||
[RECV]200 Ok | [RECV]200 Ok |
desktop_station_s_serial_communication_specification.txt · 最終更新: 2023/12/26 21:00 by yaasan