> I have to pass from a VI to a Microsoft Visual C++ DLL, a cluster with > some arrays of various data type. The problem is with Double array, > that during Visual C debug is incorrect:the dimension is correct > passed, but not array data. In the DLL I have inserted the C code > genereted by LabVIEW. I tried to pass a cluster of only one array of > double, and the results is the same. Then, I tried to pass a cluster > with scalar number and the result is correct in only one case. If the > double data is the first in the cluster, the result is correct; if the > first is another data type, such as integer or boolean, the double > data is incorrect during the debug of the DLL.
It is hard tell for sure, but you might have alignment problems. The key symptom is that you can pass a cluster of big and small fine, but small big doesn't pass correctly. You might also test this by seeing what the size of your struct is. For Boolean and Double, sizeof() should return nine bytes no matter what order the array is in. If you are getting different sizes, you have two options. You can either order them such that the sizes work, or you can build the EXE or a wrapper DLL so that the alignment matches LV's native alignment. Greg McKaskle
