北陽電機さんのUBG​センサーをmatla​bでコントロールする​には?

7 vues (au cours des 30 derniers jours)
Daichi Saitou
Daichi Saitou le 1 Juil 2019
Commenté : Daichi Saitou le 7 Juil 2019
URGファミリードライバー
というのを見つけて、そのままコピーして作動させようとしたができなかった。反応は出るが、エラーが出る。matlabに触れるのはほとんど初めてなので、プログラミングを読み解くことも容易ではありません。その為、何が良くて何が悪いのか判断が難しいです。誰か助けて!
実行1回目に出たエラー:
      「警告: 読み取りに失敗しました: A timeout occurred before the Terminator was        reached.
       'serial' unable to read all requested data. For more information on possible reasons,        see Serial Read Warnings. 」
      「関数または変数 'Scan_GUI' が未定義です。
       エラー: run (line 38)
       Scan_GUI 」
実行2回目に出たエラー:(実行1回目に出たエラーはもう出ない)
      「エラー: serial/fopen (line 72)
       開くことができません: Port: COM4 is not available. No ports are available.
       Use INSTRFIND to determine if other instrument objects are connected to the        requested device.」
      「エラー: run (line 20)
       fopen(lidar);」
マジで分からん・・・

Réponse acceptée

Kazuya
Kazuya le 1 Juil 2019
これですかね・・?
実際に試されたこと、エラーメッセージなどあるとどなたか分かる人がいるかもしれません・・。
  3 commentaires
Kazuya
Kazuya le 2 Juil 2019
Scan_GUI のファイルがないことがエラーの原因ですが
からダウンロードした run.m を実行されているのであれば、Scan_GUI の箇所を main_GUI に書き換えれば、とりあえず「関数または変数 'Scan_GUI' が未定義です。」のエラーは避けられそうです。。代わりに main_GUI があるので、入れ替えてみれば・・というレベルの推測ですが。
ダウンロードページに「Edit Run.m with the correct COM Port to use this file. 」とあるので、冒頭の Warning に関してはポート番号が関係しているかもしれません。
該当箇所:run.m 内の
lidar=serial('COM6','baudrate',115200);
Daichi Saitou
Daichi Saitou le 7 Juil 2019
main_GUIにしたら出来ました!ありがとうございます!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 起動と終了 dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!