LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

appendin array upon user select

Attached is a VI that jumps between 2 waveforms. Each time, a contrast of that waveform is calculated & should be appended to the contrast array.
But it only changes the first element - the array doesn't grow. I'm not sure why.
In my real VI, the Boolean switch is replaced by the user clicking on an image - & the same effect is seen.

Why don't the contrast values (which are being updated correctly upon user selection) get dumped into the array & stored ?

ak

0 Kudos
Message 1 of 4
(2,792 Views)
(Think about it: Currently, at every iteration you initialize a new zero-sized array and append one element. That won't get you anywhere. ;))
 
You simply need a shift register. 🙂 Check the online help and examples for details.
 
 
 
 
Your loop also needs e.g. an event structure so it executes only on demand. You don't want to grow the array by millions of elements every second. 😞

Message Edited by altenbach on 01-19-2007 04:22 PM

0 Kudos
Message 2 of 4
(2,793 Views)
Yes - I understand. I've modified it so that I would add to the contrast array every time the contrast value has changed. But that doesn't work - I think it's because the timeout is 5ms & within that window the contrast value hasn't changed. Correct ? ...Yet I can't arbitrarily increase the timeout or the entire program will run slow !

All I want to do is to populate the contrast array with contrast every time a new contrast value is created. It doesn't have to be an event sructure. Any ideas ?

Thanks,

ak
0 Kudos
Message 3 of 4
(2,748 Views)
Just put the contrast value into another shift register so you can compare the new and the previous values. If they are different, append to array.
 
See attached modification (LabVIEW 8.0)
 

Event structures only trigger from controls that are changed manually by the operator, not for indicators as in your cases. (There are ways around this, e.g. you could trigger the event by writing to a signaling property of the indicator, but that seems overkill here).

Message Edited by altenbach on 02-01-2007 01:19 PM

Message 4 of 4
(2,740 Views)