I am currently working on receiving packets of data from an external device and then ill be sending data to another device. I having a working Simulink model however i don't know how to code it in Matlab.
The parameters for the UDP receive block in Matlab are shown in this image UDP Receive Parameters
The code I have so far for making the same link is
echoudp('on', 25000)
u = udp('0.0.0.0', 25000)
fopen(u)
while True
A = fread(u, 8156, 'unit16')
end
I want to be able to read the data continuously and print it out. However the fread is giving me no data what so ever but the simulink model works fine. Any idea where i am going wrong?
This should work:
This sets up a continuous (and asynchronous) listening over UDP. For more information read this.