03-21-2018 11:49 AM
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
Solved! Go to Solution.
03-21-2018 12:09 PM
Use a case structure or a Select function to set the array value back to the initial value. Don't stop your loop.
03-23-2018 04:53 AM
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
03-23-2018 05:07 AM
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)
03-23-2018 05:19 AM
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.
03-23-2018 05:21 AM
Here is a screenshot as well
03-23-2018 06:01 AM
@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.
03-23-2018 06:18 AM
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.