12-13-2013 03:23 AM
Hi to all,
I have a problem when I want to run a model made in Simulink (.mdl) which uses a S-function that call a external DLL (my_math.dll). When I compile it using Simulink Coder, it is okey. Moreover, this model in simulink framework runs perfectly.
Then, I add in Veristand my model (DLL format) and I correctly can load it but when i try to run it, an exception appears.
My opinion is that Versitand can not find my library, but I am using an absolute path when I load the library:
"hinstDLL = LoadLibrary("C:\\example1");
sum = (MathFunction)GetProcAddress(hinstDLL, "sum");"
So, my question is: Is Veristand able to use external DLL on its model?
Thank you in advence
12-13-2013 12:33 PM
Yes, but typically the DLL needs to be in VeriStand's seach path. If you're running on an RT target, typically you need to put your dependency in c:\ni-rt\system. If you're on Windows, you can try putting it in the system32 directory.
12-20-2013 05:11 AM
C:\ni-rt\system is the default search path for LoadLibrary inside the RT.
You might want to use printf in your code to debug as that appear on the RT console (they dont go to log thou)