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?
Solved! Go to Solution.
Can you post some code/picture of code?
It is hard to guess what is going wrong.
what happens when you replace that invoke node with wiring an empty array constant to a local of that array control?
The array is labeled "appended array" and is in case 23. The invoke node is in case -1.
i"m a beginner and don't really understand what you're asking, but I'll try and figure it out.
yes, that's what I suggested...
I can't open your vi right now, but are you sure your case "-1" is really executed?
Yes, I'm sure case -1 is executed because I have regular variables that are reset there. I only have the intermittent problem with the array. I dont really understand your suggestion. I know how to create a local variable and attached an empty array constant, but dont know what you mean be array control. The array I'm talking about only exists on the block diagram.
A lot of this code should be done different, just for the reason that it is difficult to find such problems. I would suggest you browse examples about state machines to see some 'best practices'.
But I guess I found the source of your error for now: I checked the control labled '1' which is used to build your appended array. Here I didn't find any initialization code or invoke node. Maybe that's it?
I'm not sure what you mean. For each individual variable I use the invoke node and for the array I use one invoke node. I dont understand what you mean by "use a local to clear a specific control". The array I'm trying to clear isn't really a control, as it exists only on the block diagram. How would I go about clearing the array with a local. Where is the control that you're referring to?