I am sending data through ethernet from my pc to a virtex 6 fpga board. I am able to save the data in the fpga perfectly. Now I am having problems reading back data when needed. here is my matlab code:
u = udp('192.168.1.255','localport',9091,'remoteport',7,'timeout',15,'DatagramTerminateMode','off','timeout',15,'inputbuffersize',1200,'outputbuffersize',1200); fopen(u); fwrite(u,dataout,'uint8'); read= fread(u);
but read comes back empty and the following error message is seen:
Warning: The specified amount of data was not returned within the Timeout period.
any help would be great! thanks!
No products are associated with this question.
You turned off datagramterminatemode, so fread() is not going to look for any kind of terminator. Instead it is going to look only for timeout or for the input buffer to be full. You have set that size to 1200, so if you do not receive 1200 bytes of data before the timeout (15 seconds) then you are going to get that warning message.
Thanks, your probably right, but I'm more concerned with reading the data from the fpga. I'm getting nothing from fread after writing I should get dataout back. I checked the fpga side and I am getting the correct output. I just cant recieve it back into matlab.