So like the attached example? This doesn't seem to work. Though I may be missing something.
Please be more specific than "doesn't work." Do you get an error, bad data, or some other problem?
The number of bytes to copy is 4x the array length, because each array element is 4 bytes. You are only allocating enough space for 1/4 of the array elements, and then only copying 1/4 of them.
Ah yes that appears to have solved it. Thanks so much.
How did you figure out all of this? Trial and error? The documentation is pretty poor.
Mostly from reading lots of posts on this forum, especially the ones by RolfK; but also several years of C programming; a little trial and error; and reading the documentation, even though it's sparse.
Hello I have a similar problem : using Labview 2012 I have to pass a cluster parameter containing numeric values in C DLL developed with Visual C++ 20120 express (that configure serial channels on a Serial Board) as a Struct so defined :
This parameter is passed to a VI as a AdaptToType with a format Handles by Value
All the fields of the struct (except interfacetype the first one) have a shifted values (stopbits has the value for parity numbits for stopbits and so on).
This problem is raised when I have deleted from the first filed of the struct (ViInt16 channelName) and I have tried to define all the fields as ViInt32 and the parameters are passed correctly.
Someone could help me and explain this strange behaviour ?? It's a Labview bug ??
There is a way to avoid to redefine all the fields as ViInt32 in the DLL ??
This link is going to guide you to a pdf called: Using external code in LabVIEW, there is a complete chapter on how to use external Dlls in LabVIEW