フィルターのクリア

How to solve "Unsuccessful read: tcpip Timeout"

6 ビュー (過去 30 日間)
MD
MD 2019 年 3 月 7 日
回答済み: Pruthvi Muppavarapu 2019 年 3 月 11 日
Hello, everybody,
I have a Matlab (R2018a) error or a warning I'm desperate for right now. I want to send a message (or command) via TCP/IP to a server and then read the answer again. I do this as follows:
write1= '<Commandxyz/>';
write2 = '<Command123/>';
t = tcpip('172.31.1.1xx', 61xx);
pause(2)
fopen(t);
pause(2)
fprintf(t, write1);
pause(2)
read1=fscanf(t, '%s')
fprintf(t, write2);
pause(2)
read2=fscanf(t, '%s')
pause(2)
fclose(t);
delete(t);
clear t
Sometimes the transfer works but in most cases I get the following warning and an empty array back:
Warning: Unsuccessful read: A timeout occurred before the Terminator was reached.
'tcpip' unable to read all requested data. For more information on possible reasons, see TCPIP Read Warnings.
Does anyone have any idea how I can get this problem solved? I have tried to insert pauses everywhere but that didn't help either.
Thank you very much!

回答 (1 件)

Pruthvi Muppavarapu
Pruthvi Muppavarapu 2019 年 3 月 11 日
The following link addresses the possible causes of error and a way to resolve them:
Hope this answers your query.

カテゴリ

Help Center および File ExchangeData Acquisition Toolbox Supported Hardware についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by