Open an ethernet connection
古いコメントを表示
Hey everyone ! :)
I am currently trying to open an Ethernet connection with matlab. Because I'm quite new in Matlab programming, my program is not working. Here is what I've done :
echotcpip("on",2049);
t = tcpclient("192.168.10.94", 2049);
message_to_send = "11009¶1¶1";
write(t,message_to_send);
data = read(t,10);
clear t;
echotcpip("off");
I know the message to send is quite strange, but this is the logic of the external device. I'm 100 % sure that the IP adress and the port number are good. I tried to open the connection with Putty and it worked well, but now I'm trying with Matlab it timeout when it's supposed to read the data from the external device. Is my program wrong or I'm stupid and my error is somewhere else ?
Thanks you very much in advance !
回答 (1 件)
カテゴリ
ヘルプ センター および File Exchange で TCP/IP Communication についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!