This example shows how to transfer data through TCP communication protocol 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.
How to run this model in Normal Mode
- Double-click the orange button to switch to Normal Mode if needed.
- Start the real-time execution using Simulation->Run.
How to run this model in External Mode
- Double-click the orange button to switch to External Mode if needed.
- Start the real-time execution using Simulation->Run. The model will automatically build, connect to Simulink in External Mode and start.
Open the model, suppressing warning 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'));
clear close all bdclose all