10-25-2005 06:11 PM
10-26-2005 09:11 AM
10-26-2005 10:47 AM
Hi Jordan,
It sounds like this issue is due to the fact that you are not allocating memory for the dll in advance. This is the most common mistake when implementing a dll in LabVIEW.
For instance, if your dll is going to output an array of 100 double-precision numbers, then you need to allocate this place in memory by passing the dll a dummy array of 100 double-precision numbers that it can operate on. Also be careful not to expand the size of the array. LabVIEW doesn't support dynamic memory allocation within a dll in most circumstances. If you don't allocate a place in memory in advance, LabVIEW may crash when you exit the program and LabVIEW tries to deallocate memory.
A really good example of allocating various types of data for use in a dll is available from the Example Finder (Help >> Find Examples from LabVIEW). Click the Search tab and search for the term DLL. The Example is called Call DLLs. It contains c code that corresponds to various dll functions that operate on various data types, and it shows you how to call these dll functions properly from LabVIEW. For a more comprehensize overview of the process, refer to the document Using External Code in LabVIEW, available here, or browse through these Developer Zone examples and applications notes.
10-26-2005 01:53 PM
Lycangeek and Jarrod:
Thank you for your useful responses to my labview-dll trouble. Yes, it turns out that a dummy string variable/pointer I was passing to a given function of the dll was not correct. Since correcting this, the dll-call works without returning an error-value and labview is not crashing!
Much Appreciated,
Jordan