Hi
Hope this explanation isn't confusing. I've explained my desired application in text below,and also attached a skeleton VI + screenshot hoping it will clarify
I'm attempting to make a VI that does the following:
1. Some code (blue SubVI) runs every 200ms
2. Every 200ms a random number is generated
3. The random numbers are stored in an array in time intervals of 0.8s ("iterations")
4. At every point in time, the code (blue SubVI) needs to have access to the random numbers that were generated in "the previous iteration"
To clarify, the iterations are as follows:
Iteration #1: 0-1.8s
Iteration #2: 2-2.8s
Iteration #3: 3-3.8s
..
And so on..
So for every iteration: the code (blue SubVI) needs to have access to the random numbers that were generated in the previous iteration, for example:
Iteration #1 (0s-1.8s): The code (blue SubVI) gets an array containing only zero's (random numbers are recorded for the first time)
Iteration #2 (2s-2.8s): The code gets an array containing random numbers from iteration #1
Iteration #3 (3s-3.8s): the code gets an array containing random numbers from iteration #2
Iteration #4 (3s-3.8s): the code gets an array containing random numbers from iteration #3
..
And so on..
At any given point in time;
- The code is being fed an array containing all random numbers recorded during the previous iteration
- Values from before the previous iteration are discarded and not stored anywhere
So for example, at iteration #7:
- Values recorded during iteration #6 are being made available to the code in the form of an array
- Values from iterations #1 to #5 have been deleted and are not stored anywhere
It's important that all values recorded from before the previous iterations are deleted as they are not needed as the actaual VI will be running for a long time storing much more numbers than what I have indicated here
Screenshot of the Skeleton VI:
![Iteration_Scheme_PNG.png Iteration_Scheme_PNG.png]()
I've tried playing around with arrays, case structures and shift registers, but every time I try I end up doing something wrong
The Skeleton VI is also attached (Iteration_VI, and Code_SubVI)
Any suggestions?
Thanks!