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
(3,951 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
(3,945 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
(3,933 Views)
nvm.  sry im an idiot
0 Kudos
Message 4 of 8
(3,928 Views)
No problem.  Glad I could help.
0 Kudos
Message 5 of 8
(3,920 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
(3,910 Views)

and by will suffice i really meant wil NOT suffice

yup

0 Kudos
Message 7 of 8
(3,896 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
(3,895 Views)