From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dll issue

Solved!
Go to solution

Hello,

 

I created VI that use DLL file to calculate something. Also I created DLL.

In development mode there is no problem and everything function well.

When I create exe application, It also works...

 

But when I copy application on another computer, it doesn't give calculation.

There is dll beside application, but there is no calculation on last two bytes.

Also I specified path, so library node can find dll.

 

It looks to me, that VI use dll bath on some other address and not on specified... 

 

Please for advice.

 

Thank you.

 

0 Kudos
Message 1 of 4
(2,469 Views)
Solution
Accepted by topic author milan87

The Call Library Node has an error cluster that you can use to do proper error handling.

 

Although the whole application as is has none anyhow, all the FTDI VIs are pretty bad in that respect as they simply return a status. You should check each of them to return OK (value 0) before trying to attempt to do other functions.

 

So have you made sure you copy the DLL into the same directory as your executable is located? Because that is what your path calculation will pass to the Call Library Node to search for the DLL. As you pass the path from the diagram the LabVIEW application builder has no idea at what path the DLL is located, this path is unknown at compile time, and the application can not determine that this DLL is needed and therefore can't copy it for you into the resulting build location automatically.

 

Also you compiled the DLL with Visual Studio 2015. Such DLLs reference external dependencies in the form of a C runtime library. If you try to execute this DLL on a computer that has no Visual Studio installation you need to make sure the according C Runtime library is installed on that computer. Each Visual Studio version uses its own C Runtime version so you need to install the correct one. For your DLL you want to install Microsoft Visual C++ 2015 Redistributable Installer.

 

Also the DLL references UCRTBASED.DLL. The D at the end of the filename indicates that you compiled your DLL for Debugging and then it references Debug versions of these dependencies. However there is not legal way to install the debug runtime versions on a computer other than installing Visual Studio on a system. So in order to use your DLL on other computers than your Development machine you should build a non-debug version of the DLL and use that.

 

Last But not least: CRC calculation while sometimes cumbersome are a very easy calculation step. Trying to figure out how to create a DLL and debug all these issues as well as complicating your distribution and maintenance of your project (you have two entirely different code bases to manage, debug, maintain and update when something changes) almost certainly will take you a lot more time in the long run than reimplementing that algorithm in pure LabVIEW code.

 

Rolf Kalbermatter
My Blog
Message 2 of 4
(2,438 Views)

First of all thank you on fast reply.

 

I`m aware that VI is not design so good. This is just for testing.

This VI will be part of bigger one.

 

I compiled dll as release version, and not debug as before. this solve my issue.

I will definitely  try to create crc in labview, as soon as I get time..

 

thank you

0 Kudos
Message 3 of 4
(2,410 Views)

While almost every Windows 10 system most likely has the Visual Studio 2015 C runtime library installed for one reason or the other, you should never assume that a Windows system has these libraries installed when distributing your software.

Insead your distribution should contain the redistributacle C Runtime somewhere in its installer.

Sure Windows 7 is as of next week an obsolete version so soon it will probably be hard to find a Windows system without the C Runtime from VS 2015 installed. But that might change in the future again when most Windows components have been compiled with newer VS versions and replaced the old programs.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(2,361 Views)