02-21-2013 06:55 AM
Hello Everyone!
I have been searching a lot in this subject but a can't find any solutions. Please find attached the vi i am trying to get data from a 32 channel device,
100000 samples per channel with 14-bit resolution. And please also find attached the header file for my dll.(in the header it is the GetBuffers function).
It is not much data, it is little more then 6 MB but in the Task Manager LAbVIEW eats about 30 MB more memory then it should. Is there any explanations why?
Because there would be much more data in one channel(million samples or more)
So i am trying to preallocate a 2D array for the data but when i am trying to execute my vi LabVIEW crashes.
Could you help please?
Best regards,
Tomzi
Solved! Go to Solution.
02-22-2013 02:07 AM
Dear Tomzi!
To allocate data for an array in LabVIEW, you always have to initialize it, as in to have a you have to have a valid input on cell (x-,y-1) to have an array size of (x,y). It's usually best to use the Initialize Array function for this purpose.
There are to ways of passing 2D arrays to DLLs, you cand find examples of both in Examples > Communicating with External Applications > Using External Code > Integrating DLLs > Call DLL.vi. Basically, LabVIEW can only pass 2D arrays as a big 1D array, so you'll need to pass the array size too properly index it. If you pass 2D array handles it's best to use the typedef that LabVIEW generates for you, something along the lines of
/* LabVIEW created typedef */ typedef struct { int32 dimSizes[2]; double elt[1]; } TD1; typedef TD1 **TD1Hdl;
Hope this helps.
Best regards:
Andrew Valko
NI Hungary
02-22-2013 02:30 AM
Yes, i helped a lot! Thank you very much. I did not now i have to make a huge 1D array to pass data. I hope this will solve my problem.
I'll try it let you now the results!
Best regards,
Tamás Szabolics
02-22-2013 08:57 AM
Your suggestion solved my problem thank you very much!
Best regards,
Tamás Szabolics
02-22-2013 09:00 AM
Glad to be of assistance. Best of luck with your application!
Regards:
Andrew Valko