LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call Library Function - DLL with specific data types defined in .h files



@Jared_B wrote:
peter-biomed,

Looking at your .h files I don't think Son.h has any chance of being able to be called by LabVIEW without a wrapper DLL of sort.  The other header file is also going to have issues because of the nonstandard data types (TSTime, TSONTimeDate, TFileComment, etc.).

Your best bet for these would indeed be a wrapper DLL, as you will most likely not be able to get these to work in LabVIEW otherwise.  Or as you mentioned, another method.


While I agree that writing a wrapper would be definitly beneficial I can not entirely see why it wouldn't be possible without, although with lots and lots of pains. Your data types such as TSTime "typedef long TSTime", TSONTimeDate "structure with only uInt8 and uInt16 skalar values " and even TFileComment "union of a long and a fixed size character string" are not very good examples why it couldn't be done, although the latest is a little tricky.

Some of the structures in sonintl.h however are defnitly a little more complicated although they seemed to be flat too at a first glance.

Rolf Kalbermatter

 
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 11 of 12
(598 Views)


@peter-biomed wrote:

Nonetheless, I did try a few things. I noted the import library wizard just completely barfs out as it doesn't seem to be getting what it needs from the .h files. Some of the structures are structures within structures, and it doesn't seem to have function declarations that the wizard is able to use. Also trying to use the call library function returns the simple message "The configured return type is not a valid return type. The type is being changed to void." I wasn't quite sure how I could just get it to return me in a simple byte array that I could parse myself, but anyway, as I said I may not try this any further. Nonetheless, the discussion is good for future use by me and others if they should find it. And just to note, I do try to do my homework, but I must admit finding things of interest in LabView help is often like trying to find the needle in a haystack given how extensive it is. Smiley Happy   ... I suppose I should've been able to find the import library wizard though (though I think my initial attempt at this stuff was prior to me upgrading my LabView version).



The import library wizard might barf out because it can't find additional header files such as the machine.h or maybe you forgot to add some defines such as WIN32 which are needed to make the header file parsable.

I'm also not sure why you would want to change the return value of functions to anything else then skalar numerics unless you want to call that lousy function
SONChanPnt() since all other functions only seem to return skalars as their function value. This particular function can indeed not be imported by the Call Library Node since LabVIEW can not know how large the returned buffer is.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 12 of 12
(594 Views)