06-09-2009 01:41 PM
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?
Thank you.
Chuck
Solved! Go to Solution.
06-09-2009 01:54 PM
Can you post some code/picture of code?
It is hard to guess what is going wrong.
Felix
06-09-2009 02:03 PM
06-09-2009 02:15 PM
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.
06-09-2009 02:17 PM
06-09-2009 02:45 PM
06-09-2009 02:48 PM
06-09-2009 03:03 PM
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.
Thanks,
Chuck M.
06-09-2009 03:03 PM
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?
Felix
06-09-2009 03:07 PM
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?
Thanks,
Chuck M.