What causes an "Unable to load DLL dependency: KERNEL32.d​ll.GetFile​SizeEx" error on the target screen when attempting to load an SLRT application in R2018b or prior?

29 views (last 30 days)
NOTE: This article is not relevant for newer Simulink Real-Time versions (R2019a or later).
When building a Simulink model for Simulink Real-Time (SLRT) with the latest version of Microsoft Visual Studio C++ 2017, the following error is shown on the target screen (or obtained using the command "tg.viewTargetScreen") when attempting to load the application.
ERROR: Unable to load DLL dependency: KERNEL32.dll.GetFileSizeEx
Loading C:\​private\​xpcosc.dlm failed with error 127
Error: Could not load model C:\​private\​xpcosc: 127
When running the command "slrttest" the error might appear as:
>> slrttest
### Simulink Real-Time Test Suite ### Host-Target interface is: TcpIp
### Test 1, Ping target computer 'TargetPC1' using system ping: ... OK
### Test 2, Ping target computer 'TargetPC1' using SLRTPINGTARGET: ... OK
### Test 3, Software reboot the target computer 'TargetPC1': ...... OK
### Test 4, Build and download a Simulink Real-Time application using model slrttestmdl to target computer 'TargetPC1': ...Warning: Error occurred while executing the listener callback for event Loaded defined for class
MathWorks.xPCTarget.FrameWork.xPCTargetPC:
Error using SimulinkRealTime.target/XCPLoadedCB
Enter a valid application name
> In SimulinkRealTime.target/loa
  In slrttest (line 212) OK
### Test 5, Check host-target command communications with 'TargetPC1': ... FAILED
When building a model for SLRT, you may see the following warnings and errors:
### Download model onto target: TargetPC1Warning: Error occurred while executing the listener callback for event Loaded defined for class
MathWorks.xPCTarget.FrameWork.xPCTargetPC:
Error using SimulinkRealTime.target/XCPLoadedCB
Enter a valid application name
### Create SimulinkRealTime.target object tgError using coder.internal.callMakeHook
The call to slrt_make_rtw_hook, during the exit hook generated the following error:
Invalid Simulink object name: loader
The build process will terminate as a result.<...>
Caused by:
    Error using dispIfVerbose (line 31)
    Invalid Simulink object name: loader
        Error using dispIfVerbose (line 31)
        No block diagram 'loader' is loaded.
Additionally, the following warning may appear in Diagnostic Viewer:
Warning: Streaming to SDI is not available: Could not connect to XCP slave: XCP Master internal error: Connect failed

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Apr 2023
Edited: MathWorks Support Team on 3 Jan 2022
Please refer to the following bug report for fixes and workarounds:

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!