I have encountered a problem with loading a DLL in LabVIEW.
I am using LabVIEW to connect to a flow meter, and for this purpose the company that makes the flow meter was nice enough to give me a library of subVIs. Each of those subVIs calls a function from one of two DLL libraries also provided by the company.
So half of these subVIs are dependent on one DLL, and the other half are dependent on the other DLL. Those that use the first DLL work prefectly well, and there is no issue with them. But those that use the second DLL have some sort of bug : every time I open one of these subVIs, I get a popup window that says:
Error loading "absolute path\name.dll". A DLL Library initialization routine has failed.
The subVI is then not executable, and the run button is displayed as cracked. But there is a twist. If I right-click on the "configure library function node" and select Configure, then reselect the exact same dll absolute path in the appropriate field, then click OK, the subVI runs perfectly well and does exactly what it is supposed to do. I don't actually change anything in the node configuration window, I merely reselect the same path. Even stranger is the fact that this weird "trick" only works about 75% of the time. The other 25% of the time, I need to actually close the VI and any other VIs that reference it, then reopen it.
And then there is another twist that makes even less sense to me: the company also sent me a couple "example VIs" that show how the different subVIs should be used in relation to each other. These examples run perfectly well! But then I wrote my own VI that is a simpler version of the "example VI", and I keep getting the DLL load error.
What am I doing wrong, and how do I make sure that the VI is executable without having to reconfigure the Library function node every time ? What do you think is causing the problem ?
N.B: Part of the problem is that I don't really understand how reading a DLL works in labview, so any information on that would also be greatly appreciated.