How do I send data between two computers using the UDP function from the Instrument Control Toolbox?

조회 수: 23 (최근 30일)
I am using the Instrument Control Toolbox, and I would like to communicate between two computers using the User Datagram Protocol (UDP).

채택된 답변

MathWorks Support Team
MathWorks Support Team 2025년 10월 27일 0:00
편집: MathWorks Support Team 2025년 10월 27일 17:42
Please see this example in our documentation for the best way to communicate between two MATLAB sessions using UDP:
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 10월 21일
Nabeel Afridi, you can fwrite() the array in binary, or you can fprintf() the array. The code above shows a string being sent, and strings are arrays (of characters.) If the array is not fixed size you might be wanting to send the size information just before you send the array.

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

추가 답변 (1개)

Vinod
Vinod 2014년 4월 14일
편집: MathWorks Support Team 2023년 4월 27일
The UDP protocol does not guarantee transmission or order of the packets.
For most applications, you probably want to use TCPIP, like this:
  댓글 수: 1
Walter Roberson
Walter Roberson 2014년 4월 14일
Real-time communications require UDP rather than TCP, as TCP has no upper bound on packet delivery time and does not allow later packets to be delivered.
TCP is also not usable for broadcasting of any kind.
Effectively all other IP protocols other than TCP are unidirectional, so there are a lot of different applications where in-order guaranteed delivery is not suitable.

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

카테고리

Help CenterFile Exchange에서 Development Computer Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by