Angle Posted December 31, 2009 Report Share Posted December 31, 2009 Hello: In labview. I call many dll files using CLF node. During debug, everything is right. But build a .exe application, and run it , an error message show as follow: An exception occurred within the external code called by a Call Library Function Node. This might have corrupted LabVIEW's memory. Save any work to a new location and restart LabVIEW. Thanks! Quote Link to comment
Rolf Kalbermatter Posted January 28, 2010 Report Share Posted January 28, 2010 Hello: In labview. I call many dll files using CLF node. During debug, everything is right. But build a .exe application, and run it , an error message show as follow: An exception occurred within the external code called by a Call Library Function Node. This might have corrupted LabVIEW's memory. Save any work to a new location and restart LabVIEW. Why is everybody posting into LabVIEW general nowadays. This and most other topics here are clearly posts that should have been placed in the relevant thread under LabVIEW (By Category)! Just because it doesn't crash during debug run does not mean everything is right. The symptoms you describe clearly point into one of these directions. 1) You have setup an output parameter (a buffer parameter where the DLL function is supposed to write data into, such as an array or string) but forgotten to allocate memory for it before passing it to the function. While LabVIEW's automatic memory management takes care of everything as long as you stay in LabVIEW, there is no way for LabVIEW to know how big a buffer it should preallocate when calling a C function. Therefore it doesn't and relies on you to do so. You have two options here, in LabVIEW 8.5 and higher you can define the minimum size of elements LabVIEW should allocate for such a parameter in the CLN or you can do it explicitedly by using the Initialize Array function. The reason it doesn't always crash is that by not allocating (enough) memory for the buffer, the DLL function will write into some memory area anyhow. This can overwrite information that is vital to LabVIEW but sometimes also information that does not immediately lead to a crash. In an executable most diagram and other information removed and only the runtime data remaining, chances are higher that it will touch vital data so a crash is more likely but that is not a rule. It can also be opposite, or depend on the moon phase or anything else rather esoteric . 2) You configured the parameters not quite right. 3) You pass data to the DLL that trigger a bug. Quote Link to comment
Angle Posted February 2, 2010 Author Report Share Posted February 2, 2010 I have resolved this problem. Quote Link to comment
Rolf Kalbermatter Posted February 2, 2010 Report Share Posted February 2, 2010 I have resolved this problem. You could help potentially others who might use the search function before posting, by posting an explanation of what caused your problem and how you resolved it, rather than just posting that you solved the problem. This last information is more or less meaningless to everyone here as it is not our problem so if you solved it or not has little importance to us, but how you solved it may be very interesting and helpful to others. Quote Link to comment
Angle Posted March 1, 2010 Author Report Share Posted March 1, 2010 The array index exceed the max size of array. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.