From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.


Showing results for 
Search instead for 
Did you mean: 

How to clean static varable in a call library function node



I have a call library function node in a loop of a VI. The .dll file that the  "call library function node" called is complied by a c file which was created by LabVIEW CVI. In the c file, I defined a static varable like this: 


static double   a = 0;


The problem is that once the VI is finished,  the static varable "a" still keep the last value. If you run this VI again, the static varable "a" is not 0. If you want to clean this static varable, You have to close this VI and open again. Is there any methord I can clean this varable without close VI. Thanks.





0 Kudos
Message 1 of 2

Hi Haifei,

If you have "a" as the output variable, then modify your C code in such a way that another variable takes "0" from labview VI and feeds it in to the variable "a" (something like the initialisation process). So that your problem get solved.



Message 2 of 2