Showing results for 
Search instead for 
Did you mean: 

export typedef struct / typedef enum



Is there any way to export typedef struct from a C DLL to LabVIEW (so that it is refered to under 'type' when using the Call Library function?


Also, is there a way to export typedef struct?



0 Kudos
Message 1 of 3

Probably not.

Not sure if it's an issue anymore, but at one time the number one issue was the endian-ness. 

On top of that is fundamentally different handling of arrays: C arrays are just pointers, while LabVIEW arrays are smarter, containing the size of the dimension(s) within them.

Strings are likewise.


The configuration panel in CAL LIBRARY can handle some of these issues, but it has to be broken down into fundamental parts.


No way I know of to match an arbitrary structure in both languages. 

Message Edited by CoastalMaineBird on 06-19-2009 05:27 AM
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 3
I don't know of any way to automatically generate a cluster from a C struct, but if you manually create a cluster that matches your struct (it may need to contain dummy padding bytes and unfortunately I don't know enough to help with that) and you accept the value from the DLL as an array of bytes, you can typecast that to your cluster data type.  The "Adapt to Type" option might help too.  If your C struct contains pointers or unbounded arrays then everything becomes much more complicated.
0 Kudos
Message 3 of 3