LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time consuming to calculate result value by value in a array or table

You don't have to say thank you that many times, hahah..

 

0 Kudos
Message 11 of 12
(461 Views)
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

0 Kudos
Message 12 of 12
(454 Views)