03-16-2009 06:55 PM
I have a written a little VI (my first!) to send a string to a DLL that we wrote:
Our DLL exports two functions, DACQInputMsg() and DACQOutputMsg(), that receive and output strings, respectively. DACQ.dll also calls PIDebug.dll, that we use to write debugging information to the Windows debug stream.
Both DACQ.dll and PIDebug.dll live in C:\Program Files\Pulse20\
The VI _always_ complains when I first load it, that PIDebug.dll failed to load, and the VI is then un-executable. If I edit the Call Library Function, I see that the path that I had entered as C:\Program Files\Pulse20\dacq.dll has been replaced with ..\..\dacq.dll. If I just retype it as C:\Program Files\Pulse20\dacq.dll and click OK, it is still unexecutable. But if I then click Browse (which opens up C:\Program Files\Pulse20\) then click OK, then everything works.
But if I save it, close LabVIEW, and relaunch it, I have to do it all over again.
Note that I clicking Browse doesn't change what LabVIEW sees as the path to the DLL. It just seems to "wake" something up and actually load the DLL (and possibly the DLL it depends on?). The actual function call, calling convention, and arguments are correct because everything works after I re-specify and re-browse to the DLL.
Yes, we're using LabVIEW 5.1. If I can get a few things fixed and finish this proof-of-concept, then maybe I can get approval to upgrade!
Thanks!
Solved! Go to Solution.
03-17-2009 10:49 AM
Water,
Do you get any error code when the second dll fails to load? Error codes are very useful. I will try to take a look at your code but a lot of things have changed since LV 5.1 so I don't even know if I can open it in LV 8.6. You might look at the free 30-day trial of LabVIEW 8.6 (link is here). This should be more than enough time for your proof of concept to be completed and it will get you more help on the forums because very few people still have LV 5.1 to be able to open your VIs (its a great version though ). I will let you know if I find anything. Cheers!!
G-Money
03-17-2009 12:03 PM
Sorry about the red herring, it was PEBCAK. Putting C:\Program Files\Pulse20 into the Windows Environment variables fixed the problem.
Sorry to bother you all.
03-17-2009 12:10 PM
TheWaterbug,
No problem!! Happy Wiring!!