LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

strange call library function problem

Solved!
Go to solution

Hey everyone:

 

I have a program with a simple call lib. function and normally it works fine right after I wrote it but failed when I tried to run it the second time. The error code is 1097 and the notice says: "An exception occurred within the external code called by a  Call Library Function Node. The exception may have corrupted  LabVIEW's memory. Save any work to a new location and restart LabVIEW." Sometimes it works after I restart  Labview but sometimes not.

 

Someone here said before that this normally happens due to the memory manegement in labview. Any more detailed clue? Thanks!

 

 

 

0 Kudos
Message 1 of 4
(2,883 Views)
Can only give you guesses. A detailed clue would require knowing what your DLL does and what your LabVIEW code does. Guesses? Probably you're allocating memory in your DLL and you are not deallocating. Probably you're creating references and not closing them. Probably the DLL is assuming that memory has been allocated, and it has not. Probably ...
Message 2 of 4
(2,877 Views)
At last I got a sample that can work. It is bacause of a parameter should be "pass pointer to value" instead of "pass value"., which I do not really understand. Anyway, problem solved.
0 Kudos
Message 3 of 4
(2,837 Views)
Solution
Accepted by topic author ganweidodo
A pointer to a value means you're passing the location of the memory where the value is stored. The function presumably tries to update the value directly, which is why it needs a pointer to the value, rather than the value itself. If it receives just the value then it cannot update the correct memory location. It will update a memory location - it will simply be the wrong memory location.
Message 4 of 4
(2,829 Views)