LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Given a 3rd party dll how does one go about finding the dll functions.

When you have a 3rd party dll, used to drive a device over the USB interface for example, how dose one go about finding information about the dll's functions, the prototype of these functions, if they are ANSI or UNICODE versions, if their standard is stdcall(WINAPI) or C etc.
It is likely that in the very near future I will be required to communicate with an Intel 1010360 strongarm microprocessor via USB using a LabVIEW interface.
To gain experiance for this I have been attempting to interface with a USB Kodak EZ200 digital camera through the LabVIEW call library function. However I cannot find any function information for the driver vfwwdm32.dll that accompanies the device. If such info is av
ailable where can it be found? (I have searched the MSDN web resource with no luck)
I have no experience with the LabVIEW call library function and even less with dll's or win32 API (I have read the using external code in LabVIEW pdf file and successfully completed Example 3: Calling a Win32 API (MESSAGEBOX example)).
I was hoping that someone may have experience performing a similar task through LabVIEW and be able to provide me with a few tips, be it info on where to find a dlls function prototype details, further documents I should read or pitfalls to avoid. I am Using LabVIEW version 6.0 and windows XP or 2000 and will be using USB 1.1 at 12Mbits/s. Sorry about the length of this posting but any help however small would be much appreciated.
Kind regards
Declan.
0 Kudos
Message 1 of 6
(3,514 Views)
It's been my experience that the only way to get complete information about a third party dll is from the manufacturer of the device. In the case you mentioned, Kodak would have the information. Sometimes the manufacturer is willing to release the information and sometimes not and sometimes you'll have to pay for a developer's toolkit to get it.
Message 2 of 6
(3,514 Views)

Hello Dennis Knutson

I am working on the Evaluation board that is connected to the computer via usb port and i want to interface my 3rd party hardware with labview, so as you said about drivers which must be compatible with the labview then you can communicate between the labview and your 3rd party hard ware.

 

my question is if there are no drivers of our hardware which is compatible with the LabView so can we write the drivers ourselfs?

or can you please guide me that how can I interface my 3rd party usb hardware with the labview??

 

thanks in advance

0 Kudos
Message 3 of 6
(3,156 Views)

There are 2 ways to access a DLL, one is to use a CIN (see LabVIEW documentation), and the other is the Call Library Function.  The best way to go about using the functions within a DLL is to get the documentation from the source of the DLL.  Otherwise, you can find some applications that can "sniff" a DLL for the functions and the size of the data that is supplies to the function arguments.  The problem with this approach, is you can't tell what the data.  It is very difficult to make assumptions about data just by looking at the size of the data (in bits).  For instance, you may have a 32-bit input... this could be a signed long integer, an unsigned long integer, a floating point number, or maybe a pointer.  For anything that requires string input, pointers must be used.

 

In short, I have yet to find an *easy* way to use a DLL that you do not have the documentation to other than trial-and-error.  As a functions arguments increase it becomes harder to figure out what is what and what data types to use.

 

Further, even if you do have the documentation, some DLLs rely on complex data types (structures in ANSI C) that can make it pretty much impossible to use with the Call Library Function.  CLF only supports basic data types and pointers.  You could use a CIN, but I found the procedure for that to be overly complex.  What I have done when I've dealt with this complex data type as function input for a DLL problem is quite litterally write a new DLL in C or C++ that interacts with your original DLL but has simple data types as the arguments.  A free solution to do this with is with Visual C++ Express from Microsoft.

 

Good luck!

0 Kudos
Message 4 of 6
(3,152 Views)
Please stick to the original thread so others know what has already been discussed.
0 Kudos
Message 5 of 6
(3,137 Views)
Actually

Nickerbocker wrote:

In short, I have yet to find an *easy* way to use a DLL that you do not have the documentation to other than trial-and-error.  As a functions arguments increase it becomes harder to figure out what is what and what data types to use.


Actually there are no tools that can give you directly more information about a particular DLL than the function names it exports. Yes you can try to do function hooking and try to intercept and interpret the parameters it receives, but in general that only works if you already know the number of parameters it receives and also have a pretty good idea about what those parameters should contain. For most undocumented DLLs this information is not really available and if you have documentation it is not necessary to get at this information in such a complicated way.

The only fairly reliable method to find out about undocumented DLL functions is to actually study the disassembly of the DLL code, which nowadays is considered in many countries close to an attempt to perform a terror attack.

 

Rolf Kalbermatter

Message Edited by rolfk on 08-17-2009 10:14 AM
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 6 of 6
(3,084 Views)