LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Intermittent problem using "invoke node -> reinitialization to default" command to clear an array

Solved!
Go to solution
Solution
Accepted by topic author chuck72352

chuck72352 wrote:

I use the "reinitalization to default" invoke node to clear an array after sending the data to a file. The next time the vi is called the array should appear with all elements set at the default values. However occasionally the array will not be cleared and data from the previous time the vi was called is still in the arrary, or at least it appears that way since the same data for the previous time called appear in the file  when the new values are appended to the file. New data appears okay, only data points in the array which I dont update appear with the old values. And again it's an intermittent problem. I can fix the problem for a while anyway by shutting down labview and rerunning it.  Any ideas what's going on?


As others have already stated, this code is nearly unmaintainable and cannot be degugged in any reasonable way. The main problems is probably that you are reading from indicators via local variables. Thus you have to deal with potential race conditions.

 

Please get rid of all these property nodes!

 

Here's a simple suggestion: Go to VI properties...execution and select "clear indicators on each call". It might solve some of your problems, but only touches the tip of the iceberg, of course.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 11 of 15
(364 Views)
I'm not sure what control that you mean. I use a series of 19 "for" loops to load data into the appended array. When you refer to control labeled '1' do you mean the local read variable? Thank you, Chuck M.
0 Kudos
Message 12 of 15
(356 Views)

Please always quote relevant parts of posts you are replying to. Is this in respose to my posts? I cannot tell.

 

There are plenty of indicators that you read via local variables to form your array. Any of those are suspect.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 13 of 15
(355 Views)

I'm not sure what control that you mean. I use a series of 19 "for" loops to load data into the appended array. When you refer to control labeled '1' do you mean the local read variable? Thank you, Chuck M.

 

You are not using a for loop but a sequence structure when there is no sequence needed at all, just to save screen estate instead of creating a subVI for this.

 

But I mean the place upstream of the wires, where you read from all the local variables that are numbered through. The correspunding controls/indicators might not be properly initalized.

 

Felix

Message 14 of 15
(347 Views)
Thank you!
0 Kudos
Message 15 of 15
(340 Views)