I'm trying to run a cosimulation with an A/Car model with Simulink as the master. My A/Car model use some subroutines that is included in our site solver, but the cosimulation use the standard solver. I have tried to use the "User Defined Library Name" when I export my plant, but I still get the same error.
From the msg-file:
---- START: ERROR ----
Error in dispatcher subroutine sfoSUB: Invalid PAR(1): 0800
---- END: ERROR ----
Does anyone have any clue of how I solve this issue?
In the bat-file ctrlsctrl....bat, that is created when I push the run-button in Simulink, there is a row "set MDI_SOLVER_USER_LIB=C:\MSC~1.SOF\ADAMS_~1\2019.2\win64\acar_solver.dll". This points to the standard solver and I guess that it could be a clue of why it doesn't work as I want. Where do I set the value of this environment variable?
OS: Windows
ADAMS-ver: 2019.2
MatLab-ver: R2019b
Thanks in advance!
Markus Kvist
EDIT: (2022-04-14)
The co-simulation works if I update the standard acar.cfg and replace the standard solver with my site solver, but this is only a solution for my test run at the moment. So my problem is still a exists.
I have also tried to run the same model with compatible versions of MatLab and ADAMS, but the problem still remains.
ADAMS-ver: 2018.1
MatLab-ver: R2017b
How do I setup the co-simulation to run with my site settings?
The different release compatibility could be a reason. I have tried the similar thing with the MDI_Demo_Vehicle.asy and a simliar simulink model that is showed in the main question. This works fine!
So the issue is still that the cosimulation scripts doesn't use my defined solver dll. The variable ADAMS_exec in MatLab is defined with my defined solver dll, so that looks correct so far.
Is it enough to point out my local dll as "User Defined Library Name" when I create the control system in ADAMS?
If you have a private or site solver, you need to set the environment variable
MDI_ACAR_SITE
and let that point to the directory where your solver resides.
I usually tweak the bat files that start the analysis to include that environment.
Maybe a bit of fine tunung is required like putting the solve in <MDI_ACAR_SITE>/win64 or so (check the ADAMS topdir which is the required subdir for your ADAMS version & platform)
The more elegant solution is to compile your user-subs to a library like my_usersubs.dll and then use the appropriate ROUTINE statement like
ROUTINE/my_usersubs::reqsub
This dll works without any settings, if it's in the working dir