LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Check value against previous value in loop

I have a very simple vi.  It checks temperature values and if the value is above a set point value, it totals it and then writes it off to a file at the end of 24 hours.  As I said, that part is easy.  I know the next part is easy too, but I am coming up blank.  I want to check an incoming value against the previous value (this occurs every 5 seconds).  If the value is 50 degrees higher than the previous value, then add to the total the value * 100%.  If the value is greater than 200, but not greater than the previous value + 50, then add to the total the value * 70%.  If my temperature dips below 200, there are no additions to the total.

 

I think this can be accomplished with a For Loop, but I can't seem to hook up the logic to read a value and then check the next against it.

 

Ron

 

0 Kudos
Message 1 of 3
(5,972 Views)

If you use a while loop and add a shift register to it, you can compare the old and new value.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 3
(5,970 Views)

Thanks!  I'll try it!

Ron

 

0 Kudos
Message 3 of 3
(5,963 Views)