Hello,
I am new to networking. I want to communicate between 2 computers using UDP. I've been searching through Matlab's help section and stumbled across the dsp.UDPSender/Receiver functions. I am still a bit unsure as how these work.
From my understanding, this is the basic idea of how dsp.UDP works
Sending computer:
Sender=dsp.UDPSender(RemoteIPAddress,reciever.IP.Address);
% reciever.IP.Address is the IP of the dsp.UDPReceiver
Var=rand(1,256);
Step(Sender, Var)
Release(Sender)
Receiving computer
% while sender is sending info
Receiver= dsp.UDPReceiver
Var2=Step(Receiver)
Release(Receiver)
Is this set up correct? I am unsure how the step() command works. I understand it transmits data, but I don’t know when to tell the Receiver to step(). Do I run both of these at the same time? Is there a way I can make sure that data is actually being sent?
Thanks in advance,
Matt

댓글 수: 4

Walter Roberson
Walter Roberson 2012년 6월 20일
Note: somewhere along the way you must also specify UDP port numbers.
I am not familiar with the dsp UDP methods.
Have you looked at the udp() of the Instrument Control Toolbox? Or alternately at the File Exchange contribution named tcpudpip() ?
Matthew
Matthew 2012년 6월 20일
I don't have that tool box. I believe the port number is automatcially set to 25000 on the receiver and sender.
I need to use UDP because this will be implimented in real time systems
Walter Roberson
Walter Roberson 2012년 6월 20일
The File Exchange contribution tcpudpip handles TCP and UDP. It does, however, rely upon libraries that probably would not work on a real-time system (though there just might be a QNX port.)
Oscar Parra
Oscar Parra 2021년 4월 30일
hello, did you manage to make the real time system using udp? i'm doing a work on this but i can't connect. could you give me a hand with this, thank you in advance.

댓글을 달려면 로그인하십시오.

답변 (1개)

Matthew
Matthew 2012년 7월 13일

0 개 추천

The problem was I needed to run Matlab as an administrator. Also, the sending computer most use the recieving computer's IP and vice versa for communications to happen.

카테고리

도움말 센터File Exchange에서 Instrument Control Toolbox에 대해 자세히 알아보기

태그

질문:

2012년 6월 20일

댓글:

2021년 4월 30일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by