LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call library function node, exception occurs if don't open the dll manually

Hi everybody,
I have a problem when using an VI which calls a function from a dll by "Call library function node". When I run it, the error is "an exception occurs....", if I open the node and rechoose the dll from the browse button of the Node dialog then it works. Eventhough the original path of the dll in the dialog is the exact one I rechoose. So I don't know why the node can not read the dll automatically.
The weird thing is that it works if I call other functions in the library.
Did you ever meet this problem before or know how to show it?
Thank you,
Hannah
0 Kudos
Message 1 of 12
(4,245 Views)
LabVIEW uses a search path for the dll interface. If you have more than one copy of the dll file on your system this can lead to instability. This is especially a problem if the dll is installed in system32 and another is installed in the folder of your LabVIEW program.
0 Kudos
Message 2 of 12
(4,170 Views)
Hi Odd_Modem,
Thank you for your answer.
The dll is installed in a seperated folder and I try to find another copy of that in the hard drive but I don't see any.
I see that the VI automatically opens the dll at the same path but the dll name is a little bit different like this "OOIDrv32" and "OOIDRV32". Even if I change the file name to match them it doesn't work.
Do you have any more suggestion?

Hannah
0 Kudos
Message 3 of 12
(4,150 Views)
Hi,
My recommendation would be to try to recreate the error with a different DLL or simpler VI.  Perhaps you could attach your code in an attempt to recreate the issue.  This behavior might be a bug in LabVIEW.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 4 of 12
(4,140 Views)
Hi,
It has come to my attention that deleting and recreating the Call library function will fix the problem.  I believe if the call library function node has ever pointed to a different dll or the same dll in a different location then that data is somehow stored in memory causing it to not work correctly.  The problem is under investigation in the AE department here at NI.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 5 of 12
(4,122 Views)
Yes, it is exactly the problem since I had tried once to copy the dll to other folder.
Hope that you have solution for this soon. I really appreciate any suggestion for this.
Thank you,
Hannah

0 Kudos
Message 6 of 12
(4,108 Views)
Hi Eric and everybody,
I want to ask you again about the problem of call library function above. I have tried delete and recreate the node but it did not work. Have you ever had any solution for this up to now?
Thank you very much,
Hannah
0 Kudos
Message 7 of 12
(3,832 Views)

Hi Hannah,

So you've deleted the Call Library Function Node and created a new node. You've configured it for your DLL. Then when you run your VI you get the Exception occurred error? Do you have this problem with other dlls? Do you see the same problem with your VI on other computers? What version of LabVIEW are you using? Can you create a VI with just a Call Library FUnction Node for your DLL? Do you get the same error when you run that code? If you do, can you post that code and your dll?  

Regards,

Hillary E
National Instruments
0 Kudos
Message 8 of 12
(3,806 Views)
Hi Hillary,
 the VI works well with other functions from the dll. I have only one computer for that project so I have not tried with other computer.
I am not at office now, I will attach the dll and the code soon.
Thank you
Hannah
0 Kudos
Message 9 of 12
(3,793 Views)
Hi Hannah,
 
So are you have problems with just one function in your DLL? Who created the DLL? Are you calling it properly? What error are you receiving when you try to run the Call Library Function Node for that function?
Regards,

Hillary E
National Instruments
0 Kudos
Message 10 of 12
(3,778 Views)