LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV cluster data structure

In our LV application, we need to output a LV cluster which contains sevral
2D array, 1D array,interger variables, to our grading C++ DLL, could anyone
tell me the definition of cluster data structure, I just

want to know how to read the data in each section of the cluster in our C++
DLL.



I know I can slit the cluster to arra, then feed to DLL, but that will have
too many pins in my DLL, like 100 pins(may be 100 2D array ), too big.



thanks for any input .
0 Kudos
Message 1 of 2
(2,844 Views)
Richard,

I would suggest looking at the Call DLL example that ships with both LabVIEW 7.0 and 7.1. It is in the National Instruments\LabVIEW 7.0\examples\dll\data passing\Call Native Code.llb

This example shows how to send all sorts of LabVIEW data types into a DLL. It also shows you the C structure that maps to that LabVIEW Datatype.

There is an example that shows a cluster with a DBL, a string, and a 1-D array of I32s. In addtion there are 2-D array examples so you should be able to put them all together.

When you have a complex datatype in LabVIEW though, it is not uncommon to have to write a wrapper function that takes the LabVIEW cluster in and changes it around to call your actual DLL.

A trick that can be REALLY handy with LabVIEW clusters and D
LLs is to drop a Call Library Node and add 1 parameter to it. Set that parameter to be adapt to type. Don't worry about selecting a DLL, and hit ok. You then wire your cluster into the Call Library Node and right click on it. Select "Create C File" and save that file somewhere. When you open the file up it has the exact structure of that cluster as it will be passed to the DLL. That makes it a lot easier to write the wrapper that converts the LabVIEW datastructure into any structure your DLL needs.

Hope this all makes sense and helps.
0 Kudos
Message 2 of 2
(2,844 Views)