フィルターのクリア

GUIDE connect to target button

1 回表示 (過去 30 日間)
Miguel
Miguel 2014 年 10 月 7 日
回答済み: Ganesh Gaonkar 2014 年 10 月 28 日
Hello, is there any possibility for adding a button in my GUI thzt connects my model to the external target?
Thank you in advance.

回答 (1 件)

Ganesh Gaonkar
Ganesh Gaonkar 2014 年 10 月 28 日
Hi Miguel,
You haven't mentioned which target you are planning to connect to. However, in general it should be possible to create a button that can connect you to target and help you load your model on target. If you are connecting to a target over TCP/IP (like a Simulink real-time(xPC target)) then you can add a button to your UI and in it's callback use the commands for connecting to the target. For example , for Simulink real-time you can write it like below:
ip = get(handles.edit1,'String'); % This takes the ip address of Simulink Real-Time(xPC) hardware from
%a text box from UI.You can also give directly the ip address.
setxpcenv('TcpIpTargetAddress', ip);
port = get(handles.edit2,'String');% This takes port number from a text box in UI. you can also give this %directly
setxpcenv('TcpIpTargetPort', port);
if ~strcmp(xpctargetping, 'success')
error('Connection with target cannot be established');
% Now write the commands to load model here

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by