Why do I get an "Target IP Address is empty" error when I try connect to Speedgoat hardware from a standalone App Designer app?

24 views (last 30 days)
I have designed an app with App Designer following the shipped example "Add App Designer App to Inverted Pendulum Model".
I have deployed this app into a standalone application using MATLAB Compiler. I am able to successfully run this app on the computer where I designed it. But when I try to run it on another computer which does not have MATLAB installed and is connected to a Speedgoat target, I get an error saying:
"Error communicating with target 'TargetPC1': Cannot connect
to target 'TargetPC1': Target IP Address is empty.
Why am I getting this error and how can I fix it so I use this standalone application on another host computer?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 30 Nov 2022
You will see this error if the IP address has not been properly defined in the app code.
The standalone application by default does not define any targets. So when you define a target just with the command "tg = slrealtime", the address of the target is empty.
To resolve the error, explicitly set the address of the target machine using the target object in the App Designer app source code. For example:
>> tg.TargetSettings.address=''
where is replaced with the IP address of the Speedgoat target hardware.
IMPORTANT NOTE: In order to connect with the Speedgoat target, any standalone applications generated with MATLAB must be allowed to communicate through antivirus software or firewalls such as Windows Defender. See the following MATLAB answers for more info:

More Answers (0)

Community Treasure Hunt

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

Start Hunting!