main content

packet input/output -凯发k8网页登录

this example shows how to transfer data through udp communication protocol using binary encoding. the model sends data within one computer, from one udp port to another. you can modify the model to communicate between two computers by splitting this model into its send and receive parts and running the models on two computers. the yellow blocks are used to send the data, the blue blocks are used to receive the data. then, please enter the host names or ip addresses of the two computers into the appropriate fields in the board setup dialog.

run model in connected io mode

  1. to switch to connected io mode if needed, on the desktop real-time tab, select mode > connected io.

  2. to start the real-time execution, click run in real-time.

run model in run in kernel mode

  1. to switch to run in kernel mode if needed, on the desktop real-time tab, select mode > run in kernel.

  2. to start the real-time execution, click run in real time. the model builds, connects to simulink® in run in kernel mode, and starts.

open the model

these commands open the model and suppress warning about board not installed.

w = warning('off', 'sldrt:blkgui:boardnotonlist');
open_system(fullfile(matlabroot,'toolbox','sldrt','sldrtexamples','sldrtex_packetio'));
warning(w);

close open scopes

close_system(find_system(gcs ,'blocktype', 'scope'));

clean up model

clear
close all
bdclose all

see also

网站地图