LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Over flow problem ?

Solved!
Go to solution

Hello all i have program at attachment.

 

Here at Cou i supposed to if the size of array equal 10 nothing happened just remove the 10 element.

 

if the size greater than 10 or less than 10 the Boolean 2 is green all time i don't know why ?

 

any help please.

0 Kudos
Message 1 of 8
(2,673 Views)

For starters, you do not initialize the size of the appended array set in the Producer loop (If you saved this after running it, it may already have more than 10 elements.  Next, even though you reduce the appended array size by 1 in your consumer loop if it is greater than 10 elements, your producer loop is never reduced and will therefore continue to add elements without them ever being removed.  Finally, once it reaches 10 elements, Boolean 2 will always be true.  This is due to the fact that your producer loop is running 10 times faster than your consumer loop (wait delays).  If the initial size was set to 0, then you would see the following for the array size.

0 > 1{False 1}, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11{True 10}, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21{True 20}, 22, 23, 24,...

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 2 of 8
(2,643 Views)

 can you modify my vi with your answer.

 

Thanks in advance

0 Kudos
Message 3 of 8
(2,575 Views)

Your data is contained in the shift register, the indicators just display whatever is in the wire. Your local variables just point to the indicators and thus do not operate on the primary data.

 

I recommend you start with a few basic tutorials.

0 Kudos
Message 4 of 8
(2,565 Views)

1111.jpg

 

 

Hi altenbach

i really start but some times your brain stuck and reach to the point i can't rebuild or modify, so i just ask to modify that's all hope you know what i'm talking about specially if you deal with beginner.

0 Kudos
Message 5 of 8
(2,560 Views)

As I said, the wire is the variable containing the data. Don't think of "local variables" as variable is the classic programming sense, they just provide alternative access to front panel objects.

 

Before we can help you, please define exactly what the program should do, how the user interacts with it, and what you expect to see in the indicators at the various stages of execution. Also explain the purpose of all this.

0 Kudos
Message 6 of 8
(2,551 Views)
Solution
Accepted by topic author Mohammed_Kandeel

Simple change should stop the overflow.

OutOfMemory.png/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 8
(2,539 Views)

There is really still way too much code.

  • No need to zero the graphs with value property node at the beginning, they'll get rewritten with real data 100 ms later. If this is still a cosmetic issues, go to VI configuration..execution and select "clear indicators when called".
  • It would be much more efficient to operate on a fixed size array of 10 or (100?) element in the shift register. Just replace and rotate as needed (If you would convert to DBL, you could even use NaN for elements that have not been acquired and they won't show on the graphs. Just init the shift register with the fixed size array, delete everything else in the first frame, and then delete the sequence structure completely.
  • The "init all to defaults" is completely pointless for the same reason. The only control is the stop button and that is hopefully latch action so it will be at the default anyway.
0 Kudos
Message 8 of 8
(2,514 Views)