09-18-2002 09:03 AM
09-18-2002 10:56 AM
08-14-2009 01:55 PM
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
08-14-2009 02:15 PM
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!
08-14-2009 03:16 PM
08-17-2009 03:12 AM - edited 08-17-2009 03:14 AM
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