Bidirectional TCP/IP data transfer
이전 댓글 표시
I am trying to transfer data from Matlab running on a PC and wiznet wiz550io module. I am only able to send data one way from Matlab to wiz550io. Could someone please help me with the transfer of data from wiz550io to Matlab? Here is my code
if true
try
%Create a client interface and open it.
t = tcpip('163.1.6.228', 8080, 'NetworkRole', 'client');
fopen(t);
% Write the waveform to the server session.
fwrite(t, 'GET10.55')
disp('1 Success!');
fclose(t);
catch
disp('1 Failed!');
fclose(t);
end
end
if true
try
%Create a server interface and open it.
t = tcpip('163.1.6.228', 8080, 'NetworkRole', 'server');
fopen(t);
data = fread(t, t.BytesAvailable)
disp('2 Success!');
fclose(t);
catch
disp('2 Failed!');
fclose(t);
end
end
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 TCP/IP Interface에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!