05-05-2008 03:07 AM
@rolfk wrote:
I'm afraid there is no ready made tutorial about wrapper DLLs because they differ greatly depending on the actual API you want to interface too. The first thing you will need is some good C programming knowledge. Without that it is obviously difficult to write a DLL but if you don't have that knowledge interfacing to such a DLL without wrapper is even harder.
@MSS wrote:
Thanks Mr. Rolfk for your advice.
Where could I get details about creating wrapper dll. is it easy to do. what are the things that I have to have to do that?
Regards
The next step is about how to create DLLs (shared libraries) in general. This is explained for most C compilers that you could get, in the examples that come with those compilers. It's no black magic nor rocket science but mostly just following a few steps that can and will differ for each compiler to some extend.
What you want to do in a wrapper is writing a number of C functions that take more LabVIEW friendly data types (flat structures only with no embedded string or array pointers, standard C string pointers and array pointers as separate function parameters etc. etc.) and then inside those functions construct the more complex data types your real API takes. There are quite some (simple) examples about interfacing to external code in LabVIEW in general and getting these to compile and run first is definitely a good start.
You may now say but hey this is hard and I can't do that since I do not know how and all I can answer to this is that if you do not know how to do such a wrapper DLL you can never hope to successfully interface to the complex API data structures without exactly such a wrapper. So you will have to learn some C and learn how to write such a wrapper and then you can start to do it without wrapper although at that point you will likely find that trying to figure out all those nitty gritty details about structure size, correctly setting up the memory in LabVIEW to pass those parameters to the API function and all is way to troublesome, time consuming and also bad for future maintainability that you will not even consider not to create wrapper DLLs anymore expect for the most quick and dirty test cases.
Rolf Kalbermatter
05-05-2008 03:09 AM
tbd wrote:
Hi MSS,
Did your hardware come with programming examples? If so, and they're in C, consider obtaining a C++ compiler (free.) Get the examples working in C, then you'll be in a good position to "wrap" the functionality in a DLL for LabVIEW. Once you know how to compile your examples, creating the DLL for LabVIEW will be a small step. RIght now, though, it sounds like you have some learning to do!
Cheers
MSS wrote:
Thanks Mr. Rolfk for your advice.
Where could I get details about creating wrapper dll. is it easy to do. what are the things that I have to have to do that?
Regards
08-03-2009 03:12 AM
Hi,
Did you succed in interfacing with Skuetek dll?... I need to do the same...
Emmanuel