From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
I'm using code from a dll. One function creates a data structure and returns a pointer to it. (another function loads the data structure). I need to get the data out of the structure. (btw: the structure is **short; short; short; long)
I'm using code from a
dll. One function creates a data structure and returns a pointer to
it. (another function loads the data structure). I need
to get the data out of the structure. (btw: the structure is **short;
short; short; long)
How do I use thepointers in LabView?
Thanks
If you only need to get the data from the second to fourth parameter you can simply create a cluster containing
int32 pointer
int16 val1
int16 val2
int32 val3
Configure the according DLL function parameter to Adapt to Type and
wire this cluster to it. This will allow you to read the val1, val2 and
val3. If you need the pointer value too, you really can't aviod having
to create a wrapper DLL in C that extracts this information and returns
it in a way to LabVIEW that it can deal with.
Also it is very likely that the double referenced pointer will have to
be deallocated somehow at some point. This is again something you will
have to do in the wrapper DLL. How it is deallocated is completely
dependant on your DLL and should be documented in your DLL
documentation.