LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

global variable, memory

Hi,

I am using global variables in order to share values captured by one VI (as kind of data source) with other VIs, but after several days of continuous running I recieve Error 2:Memory is full.\
Please advise how can i empty global variables or use other way of sharing data between VIs continuously without interruptions.

Thanks

0 Kudos
Message 1 of 5
(3,105 Views)

You need to show us some code.


Are you sure the memory problems is due to the global variables?

 

What does the global variables contain? (e.g. an array that grows over time without bounds).

 

To "empty" a global variable, you would simply write the smallest possible size of the datatype. For example if contains an array, write an empty array to it.

 

0 Kudos
Message 2 of 5
(3,097 Views)

Hi Innka,

 

you don't get "Memory full" errors just by using global variables.

 

You get them because you

- build up arrays constantly

- open references without closing them

- similar wierd stuff…

 

So the point is: What kind of data do you store in those variables?

 

To share data you could use FGVs (FunctionalGlobalVariables aka ActionEngines aka LV2-style globals) or notifier or queues. It all depends on your requirements…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(3,095 Views)

Hi,

Maybe it will be better if I answer your questions first.

I am reading and sharing values from indicators which are communicating using .NET protocol, and the values are received as two signed 6 digit numbers (DBL) and  I am sampling the data every second. The idea was replacing the value each second and not creating the array of values.

Thanks a lot!

 

 

0 Kudos
Message 4 of 5
(3,077 Views)

@Innka wrote:

I am reading and sharing values from indicators which are communicating using .NET protocol, and the values are received as two signed 6 digit numbers (DBL) and  I am sampling the data every second. The idea was replacing the value each second and not creating the array of values.


So you don't have an array?  The the global variable is not your problem.  The .NET interface could be something to look at.  Are you opening a .NET interface inside of a loop without closing it?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(3,056 Views)