Jump to content

How to use the dll file created from Matlab/Simulink for NI Phar lap real-time and Windows targets?


Recommended Posts

Hello 

I created a dll file from the Simulink model using NI Veristand input and outputs as shown in figure 1. Later I use this dll in Labview VI and use Module interface Toolkit and export the dll in it, Its runs perfectly and there is no error with it as shown in figure 2

Now I want to use this VI for the real-time target to test the battery. I have NI PXIe-8840 device in my lab and I would like to test the battery with this VI and dll. 

Anyone who has dealt with this before and can use this Dll and VI in real time using NI PXIe 8840 device.

would really appreciate some help.

Every opinion given is worthy of respect

Thanks image.png.b44664c0becaad5ef988b3f6448d5935.png

ss.PNG

屏幕截图(3).png

Link to comment

The checker is telling you that the functions listed (which you haven't shown) are not available on the platform.

You have to resolve the bad imports (compile the DLL with equivalents or stubs) which is unlikely if you have used an automated process or wizard to create it instead of creating it yourself. If you cannot resolve the "bad imports" then you can't use the DLL on those platforms.

Edited by ShaunR
  • Like 1
Link to comment

Shaun is right. Some exports from kernel32 seem to be not supported but we can't see the list of bad functions in your screenshot.

Also the msvcr90.dll sounds weird if you run the DLL checker on the same machine that you verified the DLL to work in LabVIEW.

MSVC9.0 is the version of the MS C Compiler used in Visual Studio 2008. You need the MS Visual Studio 2008 32-bit C Runtime installed on every system that you want to execute this DLL on.

But the standard MS C Runtime can't be installed on the Pharlap ETS system since it depends on newer Windows APIs that Pharlap ETS doesn't support. NI has created certain versions of the MS C Runtime that can be installed on Pharlap ETS. You need to install the according support on each realtime target in NI Max. There are installable packages for following MS C Runtimes:

MSC 7.1 (Visual Studio 2003)

MSC 9.0 (Visual Studio 2008)

MSC 10.0 (Visual Studio 2010)

If you managed to compile your project in MSVC 6.0 then it will also work since that only uses the standard MSVCRT.DLL that is provided with every Windows installation since about Windows 95.

Only DLLs compiled with Visual Studio 6, 2003, 2008 or 2010 can be possibly made to work on NI Pharlap ETS systems. Any newer Visual Studio version or alternative C compilers are not really an option unless you are prepared to dig into linker script customization, but that is something I haven't really bothered with ever, so it is unlikely you should even try.

Edited by Rolf Kalbermatter
  • Like 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.