LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

elapsed time memory

Hi I am using 4 Elapsed Time VI's to start time counting when the boolean input is true. When I run the VI the output does not start counting at the previous value. For example:

 

compartment 4 counts for 10 seconds when the input is 'true' for 10 seconds. When the input is 'false' for 5 seconds after that the indicator remains at 10s. That is okay, but when the boolean value becomes 'true' after this total 15 seconds the indicator becomes 16s. It should start counting at 10s because that was the last moment at which the input was true. I am using Labview 8.5

 

Thanks for the assistance

 

0 Kudos
Message 1 of 3
(2,858 Views)

You have some very basic misconceptions about the way LabVIEW works. The elapsed time VI keeps time if it is in the dataflow or not. If you want a different functionality, you need to "reset" whenevert the boolean goes FALSE-TRUE.

 

Also:

  • Please don't do the "array-to-cluster-unbundle dance", a plain "index array" resized to four outputs is all you need. Keep the indices unwired.
  • It is awkward to write to a boolean inside one case and to a value property of same in the other case. If you need to write to the boolean in all cases, the terminal belongs outside case structure. In this case it can even be wired to the wire going to the case structure.
0 Kudos
Message 2 of 3
(2,849 Views)

OK, here's a quick draft how you could do it. Since you apparently want milliseconds, we can use the tick count. Since we deal with four parallel but similar code fragments, we can use a single array with four elements instead.

 

See if it makes sense to you. 🙂

 

(A lot of things don't make a lot of sense in your code, for example why do you call the indicators ms timer values if the display is actually in seconds? Why do you need four instances of basically the same code fragment? Why is timer 3 indicator near compartment 4 and vice versa? )

0 Kudos
Message 3 of 3
(2,826 Views)