Bidirectional TCP/IP data transfer
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!