LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reinitialize shift register when 5 seconds time has elapsed

I am developing an application that makes a count. On each iteration of a while loop a partial count is made, and using a shift register I calculate the total count of all iteration.
Each 5 seconds, I need the count to be reinitialized. the problem is reinitalize the value of the indicator, but I don't know how to reinitialize the value of the shift register. does anyone know how to do this?
(the purpose is to make a count and reinitialize it each 5 seconds)
Thanks!!
0 Kudos
Message 1 of 4
(2,674 Views)
Hi,

To reinitialize it, just put the default value in it. For a number, this is
0, for an array, it's an empty array. Compare the time, wire the result to a
case structure, and wire the last value or the default value, depending on
the outcome.

Regards,

Wiebe.


"Esther.Lopez" wrote in message
news:506500000008000000BBE40000-1079395200000@exchange.ni.com...
> I am developing an application that makes a count. On each iteration
> of a while loop a partial count is made, and using a shift register I
> calculate the total count of all iteration.
> Each 5 seconds, I need the count to be reinitialized. the problem is
> reinitalize the value of the indicator, but I don't know how to
> reinitialize the value of the shift register. does anyone know how t
o
> do this?
> (the purpose is to make a count and reinitialize it each 5 seconds)
> Thanks!!
0 Kudos
Message 2 of 4
(2,674 Views)
Lets assume that your loop time is constant and you know how many loop iteration it takes for the elapsed 5 seconds. Simply divide the iteration terminal with the proper constant and reset the shif register whenever the remainder is zero. See attached image example. Here the loop time is 1 seconds and the shift register resets every 5 iterations.
0 Kudos
Message 3 of 4
(2,674 Views)
From your description, I believe that the attached example is what you are looking for. Replace the random number generator times 100 with your method of obtaining a count. Hope this helps.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 4
(2,674 Views)