Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: sending and receiving data in matlab using UDP object
Replies: 33   Last Post: Apr 9, 2014 11:19 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
cpp.matlab@gmail.com

Posts: 47
Registered: 10/24/08
Re: sending and receiving data in matlab using UDP object
Posted: Mar 21, 2010 12:35 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Use real(Z) and Imag(Z).
Split one complex number into two numbers and send via UDP.

Best...



On Feb 27, 12:47 pm, "Noman " <m.neman.sha...@live.com> wrote:
> My transmitter code is:
>
> u1=udp('192.168.1.55', 9091,'LocalPort', 9090);
> set(u1, 'OutputBufferSize', 8192)
> set(u1, 'TimeOut', 10)
> fopen(u1)
> get(u1, 'Status')
> while(1)
> fwrite(u1, ubuffer(1,:), 'double');  %ubuffer is of size 1x1024
> end
> fclose(u1)
> delete(u1)
>
> My receiver code is:
>
> u=udp('192.168.1.166', 9090, 'LocalPort', 9091, 'InputBufferSize', 8192, 'TimeOut', 10);
> fopen(u);
> while(1)
> [a,count]= fread(u, 1024, 'double');
> end
> fclose(u)
> delete(u)
>
> My problem is that as soon as i increase the number of elements transmitted past 64, i can only receive 64 elements at receiver. Like if i transmit 1x1024 element array, at receiver i get first 64 elements only. Like at this line of code at receiver:
>
> [a,count]= fread(u, 1024, 'double');
>
> i only get 'a' of size 64x1, although i should get 1024x1 size of 'a'. The value of count is also 64, it should be 1024.
>
> To rectify this i have to use a loop and make a 2d array at receiver like 64x16 for 1024 element transmitted array. Also i get a warning "The specified amount of data was not returned in time" after reading every 64 elements. Is there any solution to receive all elements like 1024 in one go??? like i dont have to use loop just
> [a,count]= fread(u, 1024, 'double');
> and i get all the transmitted elements.
>
> My second problem is that i cannot transmit complex numbers usingUDP. I transmit 3 complex numbers and at receiver i only get real part of these complex numbers. Any ideas????




Date Subject Author
3/16/08
Read sending and receiving data in matlab using UDP object
pckong
3/17/08
Read Re: sending and receiving data in matlab using UDP object
Trent Jarvi
3/18/08
Read Re: sending and receiving data in matlab using UDP object
pckong
12/3/09
Read Re: sending and receiving data in matlab using UDP object
Anuradha
12/3/09
Read Re: sending and receiving data in matlab using UDP object
Anuradha
6/10/12
Read Re: sending and receiving data in matlab using UDP object
Abdul
6/10/12
Read Re: sending and receiving data in matlab using UDP object
Nasser Abbasi
6/10/12
Read Re: sending and receiving data in matlab using UDP object
Abdul
6/10/12
Read Re: sending and receiving data in matlab using UDP object
Abdul
3/19/08
Read is there a speed limite for UDP local port binding?
pckong
3/19/08
Read Re: is there a speed limite for UDP local port binding?
Trent Jarvi
3/20/08
Read Re: is there a speed limite for UDP local port binding?
Walter Roberson
4/9/14
Read Re: sending and receiving data in matlab using UDP object
Umair
3/20/08
Read Everything Looks fine now
pckong
3/21/08
Read Using Fread function and DatagramTerminateMode to take data from buffer
pckong
7/17/08
Read Re: Using Fread function and DatagramTerminateMode to take data from
Shanker Keshavdas
7/17/08
Read Re: Using Fread function and DatagramTerminateMode to take data from
K
7/18/08
Read Re: Using Fread function and DatagramTerminateMode to take data from
Shanker Keshavdas
7/18/08
Read Re: Using Fread function and DatagramTerminateMode to take data from
Shanker Keshavdas
7/19/08
Read Re: Using Fread function and DatagramTerminateMode to take data from
K
7/22/08
Read Re: Using Fread function and DatagramTerminateMode to take data from
Shanker Keshavdas
5/6/09
Read Re: receiving a file via udp
jerry adolpher
5/15/09
Read Re: receiving a file via udp
Ankit Desai
4/11/13
Read Re: receiving a file via udp
leo
7/17/08
Read Re: Using Fread function and DatagramTerminateMode to take data from
K
2/27/10
Read Re: sending and receiving data in matlab using UDP object
Noman
2/27/10
Read Re: sending and receiving data in matlab using UDP object
Noman
3/21/10
Read Re: sending and receiving data in matlab using UDP object
cpp.matlab@gmail.com
11/23/10
Read Re: sending and receiving data in matlab using UDP object
Nam Tran
11/23/10
Read Re: sending and receiving data in matlab using UDP object
Noman
11/25/10
Read Re: sending and receiving data in matlab using UDP object
Nam Tran
11/26/10
Read Re: sending and receiving data in matlab using UDP object
Noman
11/26/10
Read Re: sending and receiving data in matlab using UDP object
Nam Tran
11/28/10
Read Re: sending and receiving data in matlab using UDP object
Noman

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.