VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Veristand problem with s-function which use a external DLL

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

 

 

0 Kudos
Message 1 of 3
(6,367 Views)

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.

Message 2 of 3
(6,355 Views)

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)

0 Kudos
Message 3 of 3
(6,257 Views)