Remote address for Simulink TCP/IP block as parameter/variable from workspace?

조회 수: 8 (최근 30일)
Wilfried
Wilfried 2015년 6월 10일
답변: Githin George 2024년 10월 4일
Hi,
The parameters/variables for other blocks are set with a m-file with a callback when opening the Simulink model. The TCP/IP block seem to treat the "remote address" as IP or URL. Is it possible to set the remote address for a TCP/IP block in Simulink with a variable from workspace?
Thanks.
regards
W. Holzke

답변 (1개)

Githin George
Githin George 2024년 10월 4일
Hi Wilfried,
You can set the “Remote Address” parameter of the TCP/IP Block from a MATLAB script in the following way.
blockPath = 'myModel/TCP//IP Send'
% Get the block handle
blockHandle = getSimulinkBlockHandle(blockPath);
set_param(blockHandle,"Host",'1.1.1.1');
The command line parameter for “Remote Address” is “Host” as described in the documentation here.
You can find references to other MATLAB functions here:

카테고리

Help CenterFile Exchange에서 Development Computer Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by