LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1097 - function works in C++ application, but not in LabView

Good afternoon,

 

I have a C++ OpenCV application that I am trying to port to LabView for a co-worker. The application is fully functional when it's compiled standalone as an .exe. When called from LabView it reports error 1097.

 

However, this error is not being caused by not allocating momeory space or the way I am calling the DLL, because I can successfully run the DLL from LabView if I omit one function "findContours(..)" from being called inside my rotuine. Meaning that without this function I can send and receive an Image to my DLL and display it in LabView without a problem. This function is not being called directly from LabView either, it's called inside the main function that is being called by LabView.

 

That being said, the function allocates memory on its own for it's internal calculation purposes, I do not know what they are, but I know it works perfectly well in a standalone C++ application. 

 

My DLL application consistenly uses 180Mb of memory without any leaks

 

My Question is:

Is it possible that LabView or windows may be preventing the DLL from allocating enough memory (I have 12Gb total)?

Is it possible to run the DLL as a separate application or in a different configuration that would prevent error 1097 from occuring?

 

How could LabView possibly be restricting the DLL?

 

Thanks,

 

 

0 Kudos
Message 1 of 2
(3,045 Views)

error 1097 means that the function somewhere and somehow overwrote memory areas that LabVIEW monitors as its own during the call. This could be memory buffer function parameters  that are unallocated or to small or stack variables or some other memory areas LabVIEW puts in place around the DLL call when the highest debugging level is selected for the Call Library Node. But lowering the debugging level is not the solution as the function certainly does something that it should not do.

 

What that could be is impossible to say without analyzing the actual C source code of the function and possibly all the other functions involved in this as well as all the Call Library Nodes. It could even be that its something that is not even directly evident from the C source code but an effect of some (falsely invoked) optimization from the used C compiler.

 

I assume that you have actually a self written wrapper DLL here and that is where I would focus on in my search. It is quite unlikely that the OpenCV source code itself would still contain such errors after that much of time.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(3,028 Views)