Adams/Simulink Co-Sim ERROR: Command 11 & AEI_Initialize error

36 views (last 30 days)
Liu
Liu on 5 Jan 2026 at 17:36
Edited: Yashwanth on 14 Jan 2026 at 5:08
Hi, everyone! I am now conducting the Co-Simulation between Adams & Simulink with an MPC Controller. Now when I run the simulation, the Adams windows can properly pop out but remains still with no reaction, and later the diagnostic viewer of Simulink show an error report as shown below:
'adams_sys_/adams_sub/ADAMS Plant/S-Function' S-Function 'adams_plant' :
Internal Error during execution of command 11. AEI_Initialize: Error in initialization.
This is the case when I set the adams_sub/ADAMS Plant interprocess option as PIPE(DDE) and animation mode as interactive. When the interprocess option is TCP/IP, with working directory as correct cwd and host as the laptop which I'm now working with, the error report comes as follows:
'adams_sys_/adams_sub/ADAMS Plant/S-Function' S-Function 'adams_plant' :
Could not connect to Adams host. Check: 1. if adams_daemon is running on the host; 2. if the connection is blocked by the firewall. AEI_Initialize: Error in initialization.
Here the Adams window didn't even pop out. It seems that the Adams still needs to work with PIPE mode as now I'm only using my single laptop to observe the simulaiton. But materials about the "command 11" are rarely seened. What's the internal error and what's going on about the initialization of the S-Function module? Does anyone know what's going on here about the error? Had been stucked here for quite a long time... Timely advice would be really helpful to me! Thanks! ( ^ v ^ )

Answers (1)

Yashwanth
Yashwanth on 14 Jan 2026 at 5:08
Edited: Yashwanth on 14 Jan 2026 at 5:08
Hi Liu, here are a few resolutions you can try :
1) Start with batch (non‑interactive) to get a clear error
Switch the Animation mode to Batch (this uses Adams Solver rather than View). If Solver starts, you should get a .msg file in the working directory—open it for specific startup errors (missing files, bad model references, etc.). If no .msg appears, Solver didn’t start; load the .adm from the command line to see errors.
2) Confirm the plant/export is consistent
Re‑export the Controls Plant from Adams (Controls plugin) and then rebuild adams_sys_ in MATLAB; don’t reuse pre‑export models/maneuvers. Stale or deprecated files often cause AEI_Initialize failures.
3) Check bitness and S‑Function binaries
Verify that the correct adams_plant.mexw64 (or mexw32 if 32‑bit) exists and matches your MATLAB bitness; MATLAB 64‑bit will not load a 32‑bit mex. Path examples are in Adams install under controls/win64 or win32.
4) For TCP/IP mode: basic connectivity
Make sure adams_daemon is running on the host and the Windows firewall allows the Adams port(s). If blocked, Simulink’s S‑Function will report “Could not connect to Adams host.”
Prefer PIPE/DDE on a single laptop; TCP/IP is supported, but it’s slower and you must deal with firewall/security policies and configure ADAMS_host properly.

Products


Release

R2025a

Community Treasure Hunt

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

Start Hunting!