ユーザ用ツール

サイト用ツール


desktop_station_s_serial_communication_specification

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
desktop_station_s_serial_communication_specification [2015/02/20 06:15]
yaasan
desktop_station_s_serial_communication_specification [2023/12/26 21:00] (現在)
– [外部操作の注意点] yaasan
行 4: 行 4:
  
 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. 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.
 +
 +このページでは、Windows上で動作するDesktop Station Softwareと、DSmainR5や、DCC/MM2シールド装着済みArduinoUNOにDSGatewayを書き込んだものと、シリアル通信で指令を送る際のコマンド体系を解説しています。この解説を元に、WindowsやMacでオリジナルのソフトを作って、DSmainなどを自由に制御できます。
  
 ===== How to communicate ===== ===== How to communicate =====
  
-The following table describes serial communication configuration. +The following table describes serial communication configuration. \\  
 +シリアル通信設定は以下のとおりです。
  
 |Parity | None | | |Parity | None | |
行 18: 行 21:
 Desktop Station sends to Arduino with DSmain or DCC/MM2 shield  that the end of command text is as line feed code "\n (0x0A)". Desktop Station sends to Arduino with DSmain or DCC/MM2 shield  that the end of command text is as line feed code "\n (0x0A)".
  
 +コマンドの構造は、「コマンド名(引数1,引数2,・・・)\n」となっています。命令の最後はLF(改行コード)を必ず付けてください。大文字小文字を考慮します。
  
 +コマンドを送る場合、200 Okの応答からウェイトを最低100ms以上置いてください。内部で処理を行ってDCCパルス生成器を確実に動作させるために必要です。
 ===== Command list ===== ===== Command list =====
  
 ^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,100,2)\n | |setLocoSpeed| Locomotive address, Speed, (Speed Step)| setLocoSpeed(5,100,2)\n |
行 28: 行 34:
 |setTurnout| Accessory address, Turnout Direction | setTurnout(5,1)\n | |setTurnout| Accessory address, Turnout Direction | setTurnout(5,1)\n |
 |getS88| S88 decoder count | getS88(2)\n | |getS88| S88 decoder count | getS88(2)\n |
-|setLocoConfig| dammy, CV No, CV Value | setLocoConfig(0,1,3)\n |+|setLocoConfig| CV Address, CV No, CV Value | setLocoConfig(49152,1,3)\n | 
 +|getLocoConfig| CV Address, CV No | getLocoConfig(49152,1)\n |
  
 ===== Parameter meaning ===== ===== Parameter meaning =====
行 41: 行 48:
 |Locomotive Direction | 1-2 | 1:FWD, 2:REV | |Locomotive Direction | 1-2 | 1:FWD, 2:REV |
 |Accessory address | 0-65535 | See the following address description.| |Accessory address | 0-65535 | See the following address description.|
-|Turnout Direction | 0-1 | 1:Straight, 0: diverging|+|Turnout/Signal Direction | 0-1 | 1:Straight(Green), 0: diverging(Red)|
 |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's CV number |+|CV No | 0-1023| Locomotive's CV number |
 |CV Value | 0-255 | Locomotive's CV Value | |CV Value | 0-255 | Locomotive's CV Value |
  
 +以下のテーブルは、ロコとポイントのアドレス(1-65535)の意味をあらわしてます。\\ 
 The following table describes Locomotive's and Accessory's address meaning. The following table describes Locomotive's and Accessory's address meaning.
  
行 64: 行 72:
 |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. |
 +|@PWR,SWITCH,| 電源操作されて発生する状態変化通知|
 +|@DIR,XX,YY,DIR,| 進行方向操作されて発生する状態変化通知 |
 +|@FNC,XX,YY,NO,SWITCH,| ファンクション操作されて発生する状態変化通知|
 +|@ACC,AA,BB,DIR,|ポイント操作されて発生する状態変化通知|
 +|@SPD,XX,YY,SPD_H,SPD_L,|速度操作されて発生する状態変化通知|
 +
 +===== 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", you can send commands.
 +  - Firstly you need to send "setPower(1)".
 +  - The output of track is available. Send commands which you want.
  
  
 ===== Example of communication log ===== ===== Example of communication log =====
 +
 +以下は、通信ログの例です。setPing()を投げて生存確認をしてから、setPower(1)で線路電源のON、そのあとはコマンドを打てばその通りにDCC信号が出力されます。
  
 <code> <code>
-[RECV]200 Ok+[RECV]100 Ready
 [SEND] setPing() [SEND] setPing()
 [RECV]200 Ok [RECV]200 Ok
行 105: 行 131:
 [RECV]200 Ok [RECV]200 Ok
 </code> </code>
 +
 +===== 外部操作の注意点 =====
 +
 +  * 本体でDCC電源のON/OFFを操作された場合、本体側の操作が優先されます。@PWRで操作状態が応答されますので、その値を見て制御を行ってください。
 +  * 本仕様書は随時更新されます。また、予告なしに仕様が変更される場合があります。
 +  * 本仕様書に記載の事項で、自動運転装置をビジネス・業務としてインテグレーションすることは自由ですが、当社は一切の動作保証、環境に起因するサポートをいたしません。ビジネス・業務用途での個別サポートを要求される場合には、サポート契約を申し込みください。サポート契約外のサポートについては一切お断りいたします。
 +
 +
 +
 +
desktop_station_s_serial_communication_specification.1424380540.txt.gz · 最終更新: 2015/02/20 06:15 by yaasan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki