Why does 'slrtpingtarget' fail?

2 views (last 30 days)
Why does the 'slrtpingtarget' command fail after I boot and connect to my target PC with Simulink Real-Time R2020a or earlier?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Dec 2022
Edited: MathWorks Support Team on 9 Jun 2022
The command 'slrtpingtarget' (formerly 'xpctargetping') can fail for various reasons as it involves the full connection chain of the host PC, Ethernet cable, and the target PC. Malfunctioning of anything along this pipeline, at software or hardware levels, can lead to the failure of 'slrtpingtarget'.
Below are some common issues and countermeasures:
1. Hardware & Ethernet Card Configuration
Make sure to use a working Ethernet cable. Make sure the used Ethernet cards are recognized Ethernet cards on the host PC and the target PC, respectively. There are cases when a target PC has more than one Ethernet card, and the Ethernet controller is choosing the wrong one. A timeout can happen if things are not correctly set up and will cause 'slrtpingtarget' to fail. This documentation page discusses issues with multiple Ethernet cards.
2. Boot Kernel Mismatch
'slrtpingtarget' can fail if the target computer is running an old Simulink Real-Time boot kernel that is not synchronized with the Simulink Real-Time release and update installed on the development computer. Recreate the target boot kernel for each new release.
3. Invalid Target Settings
Make sure you are using valid target settings such as IP address, subnet mask, index, etc. One can retrieve the target hardware information following this documentation. Make sure the settings match between the target object and the actual target hardware.
4. Firewall Interference
Make sure to add the matlab.exe process to the exception list of the host PC's firewall. For Windows Firewall, the instructions are captured in this article .
ln case you use network boot, also make sure to add Simulink Real-Time related processes such as 'xpcbootpserver' and 'xpctftpserver' to the exception list of the host PC's firewall. In addition, notice this documentation .
5. Port Issue
In some cases in older MATLAB releases, the 'xpctargetping' command may be using a different port other than the one set in the target settings. For example, if the target setting uses port 22222 for host-target communication, 'xpctargetping' may use 22223 for pinging. If the port being used for 'xpctargetping' on the target is not functioning correctly, 'xpctargetping' will fail, leading to auto build and download failure since 'xpctargetping' needs to pass before the model is downloaded to the target PC. In this case, the following workaround may help:
  • Download the attached modified targetping.p file which is attempting to connect to target in a slightly different way
  • Start MATLAB in administrator mode
  • Type cd([xpcroot,'\xpc\+xpctarget\@xpc'])
  • Rename the existing targetping.p to targetpingOLD.p as a backup
  • Copy the downloaded targetping.p file to that directory
  • Execute 'rehash toolbox'
  • Try 'xpctargetping' several times and there is a good chance it will succeed.

More Answers (0)

Categories

Find more on Multicore Processor Targets in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!