11-16-2006 09:31 PM
I will check these out soon...but keep in mind the last bullet of the first link addresses the situation where one is showing the front panel of the called DLL (which by the way I did not know one could do), and if one's system is crashing, rather than hanging. I am not showing the DLL front panel (have to learn how to do that because it could be a great idea for this application) and my run is not crashing, only hanging.
My code overall is not that complex but does involve a number of matrix math operations. I am starting to wonder if memory allocation could be the issue. But if so, I would have expected a crash and not a hang.
Sincerely,
Don
12-06-2006 08:30 AM
I have some updates on this topic. In the original code, I operated on input 2d arrays that produced output 2d arrays. I revised my LabVIEW-created DLL to read in .bmp images from a folder on disk, and to write out .bmp images to disk in place of these arrays. This strategy worked fine in the sense that I was then able to place the dll on a LabVIEW block diagram, configure it, and test it successfully.
However, then I went back to see what would happen if I produced an array of 2d arrays (3d array) rather than a set of .bmp images as the output. During testing/running of the dll within LabVIEW, I get an exception occurring within the node. I am attaching a screenshot that shows how I configured the DLL prototype, and then configured the call library function node. Is there a logical explanation as to why such an array is creating trouble? What is the workaround? Does the fact that it will not successfully run in LabVIEW mean that it definitely will not run within another programming environment?
Thanks,
Don
12-06-2006 02:24 PM
ps. I am looking for a guinea pig to integrate the working DLL into c++. In trade for testing and documenting how you did the integration, you get to keep the DLL which calculates the principal component images for a time-series of images. Here is the zip file containing all of the necessary files (such as .h file) and also an example time-series of images.
"This DLL calculates Principal Components (PCA) Images and stores them as .bmp images to disk. It is fairly rapid. Specify:
1) the folder location of the I vs. t .bmp images (char string)
2) the starting frame # I vs. t .bmp image to use in the analysis (I32)
3) the ending frame # I vs. t .bmp image to use in the analysis (I32)
4) the number of principal component images to calculate (I32)
I save the PCA images in the same folder as the original I vs. t bitmaps are stored. I name them *_PCA.bmp with * being equal to 1 to n where n is the number of PCA images you have chosen to calculate."
Thanks,
Don
12-07-2006 06:58 PM
12-08-2006
09:54 AM
- last edited on
07-17-2024
02:32 PM
by
Content Cleaner
Tried and received only 1 value back at first array position of 3d array. At least did not crash. Not sure why entire array not filled. I initialized the array using 200 x 200 x 10 positions which would be a little larger than necessary....Don
ps. for those wanting to test working DLL in c++, you need LabVIEW 8.2 run-time engine if you do not have LabVIEW 8.2
12-12-2006 12:44 PM
12-13-2006 11:13 AM
The VI itself does not need a preallocated array. It just forms the array it needs via autoindexing on the outside of a for loop.
Right now, it seems the best thing to do is stick with my working code. But I sure would like to figure out how to work with multiple-dimension arrays in DLLs since they cannot be passed by value. I am sure it is something basic I am doing wrong having to do with how memory must be allocated and how the arrays are passed back into LabVIEW. I have read almost all documentation in LabVIEW related to formation and use of DLLs, though, plus the tips you have provided (some of which have been confirmed by the docs) but the solution has not hit me yet. Probably the best strategy will be to keep building very simple examples until the lightbulb goes off. Or maybe someone else has had success with building DLLs having multi-dimension arrays as outputs.
Sincerely,
Don
05-23-2008 07:18 AM
05-28-2008 08:53 AM