Just for simplicity, you can also use autoindexing on the output. 🙂 (see attached, LabVIEW 7.0)
(A FOR loop will automatically allocate the correct output array from the beginning, so there is no performance penalty.
Also note that you sometimes don't update the value for the output (big case=FALSE), thus the table gets a historic value. Use a shift register if this is the desired behavior.)
Notice also that you have a serious race condition, because you cannot tell what happens first:
- writing of "element 2" local variable inside the case structure
- --OR--
- replacing the array element with the new value of "element 2"
Your result will vary depending on this unpredictable behavior. This is very bad!
Message Edited by altenbach on 01-09-2006 08:31 AM