Receiving information with TCPIP object
이전 댓글 표시
Greetings, I have written a script to receive an array of numbers from another computer with a TCPIP object, I'm doing so with an event function handler. Here's my code:
t = tcpip('0.0.0.0',30000,'NetworkRole','server');
t.BytesAvailableFcnCount = 20;
t.BytesAvailableFcnMode = 'byte';
t.BytesAvailableFcn = @received;
fopen(t)
and here's the "received" function:
function X=received(t,A)
X=fread(t,t.bytesavailable/4,'float')
end
The information is received without errors, but for some reason the number array I receive is not stored in the "X" variable or anywhere, I have no idea what the problem could be. Can any of you help me with this issue?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!