パソコンと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

 Akzeptierte Antwort

Kojiro Saito
Kojiro Saito am 7 Jul. 2022

1 Stimme

クライアントから計測機器に接続するために、クライアント(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 Kommentare

健志
健志 am 8 Jul. 2022
貴重なご見解ありがとうございます。TCPポートはtcpclientで設定した80で設定するものと勘違いしておりました。接続している計測器のTCPポート番号はどのように設定するのでしょうか?もしくはどのような調べ方があるでしょうか?コマンドプロンプトのnetstatで検索しても相手のIPアドレスが見れませんでした。
Kojiro Saito
Kojiro Saito am 8 Jul. 2022
Portqryというマイクロソフトが提供しているツールをダウンロードして調べられます。
実行例 portqry -n 172.24.31.10 -r 1:65535
「計測機器の名前 TCP デフォルトポート」 でググったほうが早いかもしれません。
健志
健志 am 10 Jul. 2022
ありがとうございました。おかげさまで検索できました。

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Instrument Control Toolbox Supported Hardware finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2020b

Tags

Gefragt:

am 7 Jul. 2022

Kommentiert:

am 10 Jul. 2022

Community Treasure Hunt

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

Start Hunting!