LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling DLLs from relative path

Hello,

I have a problem with calling a DLL from a relative path while using the Call Library Function.

 

At the beginning I used an absolute path because it was faster/easier to test the VI, but since the program has to work on other user accounts etc. and has to be compiled as *.exe this is no longer an option and I have to use relative paths.

In _main_path the main VI-path gets written as global var and I combine the paths to where the DLL is stored (see fig1).

The created path is correct (since I use this construction method in other parts of the VI as well and it does what it should do there), the DLL exists there under its name; reviewed it a 1000 times and the file-existing VI also says it exists, so that’s not the error here 😉

 

The error message is shown in fig2:

 

 

Why does this way of creating the link to the dll not work? When click to properties of the Call Library Function and set the path to the DLL manually everything works just fine as it did before.

 

SW used: LV 2011 SP1, W7 64 Bit

 

 

br

Stefan

Download All
0 Kudos
Message 1 of 7
(3,723 Views)
Create an indicator after your build path and check the path,and then create exe and check the path, I think then you can get some idea.
Thanks
uday
0 Kudos
Message 2 of 7
(3,712 Views)

Hi udka,

 

i know the pitfall you are refering to (trapped in it a long time ago ;)), but the problem in this case is not in the exe but in the VI.

 

The problem exists while running it as normal VI, thats what confuses me...

 

br

stefan

 

 

0 Kudos
Message 3 of 7
(3,709 Views)
Okay,

May be problem is in code like you said. Check if this link might help you.
According to the discussion in link, it appears that whenever an assertion defined in the code is false this popups. May be correcting that should solve problem.
Thanks
uday
0 Kudos
Message 4 of 7
(3,703 Views)

Hi,

 

there is no link in your post?! 😉

 

br

stefan

0 Kudos
Message 5 of 7
(3,691 Views)
Sorry 😛 here it is.

http://social.msdn.microsoft.com/Forums/en-US/0f287b5f-c1e1-4cd9-a0f0-
a418def88edd/debug-assertion-failed
Thanks
uday
0 Kudos
Message 6 of 7
(3,687 Views)

You may have a race condition.  Is your global variable populated before you use it?

 

Another way to solve this is to put the DLL in the system search path (e.g. next to your EXE or in the system folder) and specify only the name in the DLL call.  This will give you better performance if you call the DLL more than once.

0 Kudos
Message 7 of 7
(3,648 Views)