05-01-2018 04:50 AM
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.
Solved! Go to Solution.
05-01-2018 07:14 AM
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,...
05-14-2018 03:36 PM
can you modify my vi with your answer.
Thanks in advance
05-14-2018 04:33 PM
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.
05-14-2018 04:46 PM
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.
05-14-2018 05:27 PM
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.
05-15-2018 03:21 AM
Simple change should stop the overflow.
/Y
05-15-2018 09:13 AM
There is really still way too much code.