Is it possible to send and receive UDP packets in one GUI concurrently or one GUI able to communicate with multiple UDPport ?

3 ビュー (過去 30 日間)
I have implemented an application using GUIDE to send and capture UDP packets over network.I have assigned (sending)PC1 by '10.90.1.37' ip and 4001 port, (reciving)PC2 by '10.90.1.249' ip and 4002 port .I want my application to to send and capture UDP packets packets parallely. Currently my application is able to perform either send or recive.I dont have much idea on instrumentation toolbox. So please help me out in completing my application which can do both task.
Thanks in advance.

回答 (1 件)

Narvik
Narvik 2024 年 1 月 23 日
Hi,
To implement an application using GUIDE to send and capture UDP packets simultaneously, you need to set up two different UDP objects: one for sending and the other for receiving UDP packets.
Below is a general overview of what you have to do:
  1. Create two UDP objects, one for sending data to PC2 and another for receiving from PC1 and configure them accordingly.
  2. Define callback functions for sending and receiving data.
  3. Ensure that the UDP objects are cleared to avoid leaving open connections.
Make sure that all the appropriate callback functions are defined and the UDP objects are initialized when the application starts.
Refer to “udpport” function for creation, configuration and setting up callback functions from the documentation link below: https://www.mathworks.com/help/instrument/udpport.html
Refer to the following documentation for more information on UDP interface:
Hope this helps!

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by