Receiving information with TCPIP object
Afficher commentaires plus anciens
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?
Réponses (0)
Catégories
En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!