ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

creating a temporary value

hi all,
i am trying to create a temporary value for a timestamp so that i can calculate the time difference between timestamps.  i was wondering if anyone knew a way to temporarily store a value aka the previous timestamp so that  i can simply subtract the difference between the current and previous times. thank you
0 Kudos
Message 1 of 8
(4,179 Views)
What you want to do is use a shift register.  The shift register will allow you to store the value and pass it around the loop for the next iteration.  You can change a loop tunnel to a shift register by right-clicking and selecting "Change to shift register".  Check out the example VI attached.
Message 2 of 8
(4,173 Views)

thanks endmile

i ran the vi and it worked for the most part.  i was just wondering if the set time difference ever worked for you? or how i could make it work...

0 Kudos
Message 3 of 8
(4,161 Views)
nvm.  sry im an idiot
0 Kudos
Message 4 of 8
(4,156 Views)
No problem.  Glad I could help.
0 Kudos
Message 5 of 8
(4,148 Views)
turns out that a shift register will suffice. does anybody know a way of creating a temporary variable within a loop that can be used for the next iteration?
0 Kudos
Message 6 of 8
(4,138 Views)

and by will suffice i really meant wil NOT suffice

yup

0 Kudos
Message 7 of 8
(4,124 Views)
Yes, it's called a shift register.
 
What exactly are you having a problem with? You just said that the shift register will suffice! Maybe if you posted the code you've written, someone can look at it.
0 Kudos
Message 8 of 8
(4,123 Views)