필터 지우기
필터 지우기

tcpclientの使い方

조회 수: 2 (최근 30일)
健志
健志 2022년 7월 7일
댓글: 健志 2022년 7월 10일
パソコンと1対1でLAN接続された計測機とのやり取りをしたいです。
コマンドプロンプトのpingは以下の通りつながっていることを確認しております。
172.24.31.10 からの応答: バイト数 =32 時間 <1ms TTL=64
以下のエラーについてはどのようなことが考えられるでしょうか?
t = tcpclient("172.24.31.10",80,"Timeout",20,"ConnectTimeout",30)
Cannot create a communication link with the remote server. Please check the input
arguments(ADDRESS and PORT) and make sure the server is running.
Additional Information: Ώۂ̃Rs[^[ɂċۂꂽ߁Aڑł܂łB

채택된 답변

Kojiro Saito
Kojiro Saito 2022년 7월 7일
クライアントから計測機器に接続するために、クライアント(tcpclient)はTCPプロトコルを使って指定したポート番号にアクセスしに行きます。
現在出ているエラー「Cannot create a communication link with the remote server. Please check the input
arguments(ADDRESS and PORT) and make sure the server is running.」は、ポート80番でつなぎに行ったけど、セッションが確立できなかったということになります。
pingはICMPというプロトコルを使っているので、tcpclientが使うプロトコルと少し違います。
計測機器がLISTENしているTCPポートが80で合っているか、今一度ご確認ください。
  댓글 수: 3
Kojiro Saito
Kojiro Saito 2022년 7월 8일
Portqryというマイクロソフトが提供しているツールをダウンロードして調べられます。
実行例 portqry -n 172.24.31.10 -r 1:65535
「計測機器の名前 TCP デフォルトポート」 でググったほうが早いかもしれません。
健志
健志 2022년 7월 10일
ありがとうございました。おかげさまで検索できました。

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!