LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reset an array after Value Reached

Solved!
Go to solution

I need help with resetting an array after i reach a certain value within my code. To be more specific (hopefully), I want to reset the entire array (there are two of them I would like to have reset, but once the first one is done, I'm sure I can follow the same steps to complete the second one). 

 

I will try to be specific in my code what I want to reset.

 

Once my "result 2" becomes true, I would like to reset my "Counter" array and my "output array 2" so there is nothing in them (basically as you would restart the program). I don't know if adding a Boolean switch would help this case.

 

I hope I am wording this correctly, and any input would be greatly appreciated. Also, if there are any tips to improve my code, that is always appreciated as well. Thanks in advance

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

Use a case structure or a Select function to set the array value back to the initial value.  Don't stop your loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(2,950 Views)

Would I place the case structure around the while loop, or just have it at the end where the stop was?

 

Have tried it a few different ways but cannot get it to function properly. Any tips would be appreciated. 

 

Thanks

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

wouldn't mind taking a look, but i still run on labview2016, so i can't open your vi,

could you backsave it to 2016?

(File -> Save for previous version)


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 4 of 8
(2,910 Views)

Let me know if that worked. (I don't have 2016 so I don't know if that affects it). I did as you stated.

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

Here is a screenshot as well

 

 

0 Kudos
Message 6 of 8
(2,905 Views)

@Brschnei wrote:

Would I place the case structure around the while loop, or just have it at the end where the stop was?


Stop and think instead of randomly putting things anywhere.  Why would a case structure around the entire loop make any sense?  The data is only INSIDE of the loop.  The case structure should be fed by the comparison inside of the loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 8
(2,899 Views)
Solution
Accepted by topic author Brschnei

hi breschnei,

so like crossrulz said, you want to put in a case-structure to reset the counter array.

 

i cleaned up the code a little and put in a few comments,

but your code makes absolutely no sense to me 😞

 

perhaps you should post, what you really want to accomplish with your program.

 

somevi-01.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Download All
Message 8 of 8
(2,895 Views)