stream input/output -凯发k8网页登录
this example shows how to transfer data through tcp communication protocol by using ascii encoding. the model sends data within one computer, from one tcp 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
to switch to connected io mode if needed, on the desktop real-time tab, select mode > connected io.
to start the real-time execution, click run in real-time.
run model in run in kernel mode
to switch to run in kernel mode if needed, on the desktop real-time tab, select mode > run in kernel.
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 warnings about board not installed.
w = warning('off', 'sldrt:blkgui:boardnotonlist'); open_system(fullfile(matlabroot,'toolbox','sldrt','sldrtexamples','sldrtex_streamio')); warning(w);
close open scopes
close_system(find_system(gcs ,'blocktype', 'scope'));
clean up model
clear close all bdclose all