Solution
There are several different reasons LabVIEW might crash while calling a DLL function methods to prevent this type of crash are listed below:
1. Make sure you are using the same calling conventions as the DLLIf the calling convention specified in the Call Library Function Node does not match the calling convention of the DLL, it will cause a crash. The calling convention is specified in the lower right portion of the Call Library Function node window, as seen below.
2. Make sure that you wire all inputs and outputs of your Call Library Function NodeIf you do not wire the all of the inputs and outputs of a Call Library Function Node, the DLL function will overwrite unallocated memory and cause LabVIEW to crash.
Note: If your second input is a pointer to your first input, then your first input does not require an output.
3. Make sure the DLL function is not overwriting LabVIEW memoryIf not enough memory is allocated or the DLL function writes more than has been allocated, the DLL will overwrite reserved LabVIEW memory space and cause LabVIEW to crash. Make sure that memory is allocated properly before passing in and reading out arrays, strings, or waveforms from DLLs.
4. Make sure that LabVIEW is passing parameters to the function in the format that the function is expectingCalling the DLL function from LabVIEW with incorrect parameter datatypes (by value, reference, handle, etc.) can cause the function to unintentionally point to an incorrect memory location resulting in faulty data, or even a crash of LabVIEW or Windows.
5. The function call itself does something illegalIf a function attempts to perform an illegal operation, it might crash LabVIEW. If you are not the author of the function, contact the writer of the function.