main content

basic udp communication -凯发k8网页登录

this example shows how to transfer data over the udp network using simulink®.

instrument control toolbox™ provides simulink® blocks for sending and receiving data over tcp/ip and udp networks. this example uses the udp send and receive block to perform data transfer over a udp network.

this example requires simulink to open and run the model.

open_system('demoinstrsl_udpcommunication');

close_system('demoinstrsl_udpcommunication');

setup

the input signal sent to the udp send block is a sine wave of frequency 1 radians/second. the udp send and receive blocks use the 'localhost' for transferring data across two different ports. the port selected for the two udp blocks are 51000 and 51001.

result

the resulting sine wave is seen in the scope block connected to the udp receive block.

in this example, the udp send and receive blocks exist in the same simulink model and are run on the same machine. however, you can also use the udp send and receive blocks in two different models and communicate across two different machines.

网站地图