ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
09-15-2008 02:00 PM
I'm trying to run a simple DLL from LabView. After working out a few bugs, it doesn't cough at me when I configure the Call Library Function Node. When I run the program though, nothing happens (meaning the function doesn't get called and no error returned). All I have is the DLL call in the VI. There is no error returned, but the code doesn't run the function called. The DLL ran fine in a test application to make sure it would run. But in LabView, nothing happens.
The return type is Bool, which I'm just using a signed 32-bit integer for. There are several functions and I've tried them all. The simplest doesn't have any argument to pass and still no success.
Ideas???
09-15-2008 03:40 PM
Hmm...really hard to tell you what's going wrong, but let me just make some suggestions:
- You have written your DLL in C++? If you are using for example Visual C++ (Microsoft, the Express Edition is free), you can use the debugger. So compile your DLL as debug-version, copy it to your LV-Project-Directory. Then, start LabView, open your program. In C++, Select "Debug-->Attach to process". In the process list, you should see LabView. Select it and run the debugger. Set a breakpoint in your code (click on the left of the code). If you see a red filled circle, the code will be processed if you run your program. If it's only a non-filled circle, the point in your program will not be hit, so you have to check the configuration of your Call Library Function Node. Set a breakpoint to the beginning of your function. Now, start your LabView program. The breakpoint should be hit, and you can now process your C++-Code with "F10" and see what happens (If everything is going as desired).
- Try to write something like "return 10;" into your code and look if you get this value out of LabView as return-value.
Hope this helps.
Greetings, Christian
09-16-2008 10:20 AM
Hi,
I think the suggestions provided above are excellent but I would like to add another thing. I am not sure if you are calling the DLL properly, but please take a look at an example called Call DLL.vi which is found in the Example Finder (Help »Find Examples...). This example shows you how the Call Library Function Node should be configured for each datat ype. This might elucidate an error you have in the way you have configured your code.