LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sum values to display total (running total)

Solved!
Go to solution

I apologize for posting such a rudimentary question but I haven't been able to find an answer by searching the forum.

Basically, I have several sensor inputs that are all factored into an equation that yeilds heat output (btu/hour). I need to take this value, which I have iterating once every second, and add it to itself every time it increments. In other words, say the first value is 10 (btus), the next second the value is 16, the code calculates and displays a value of 26 on the front panel and waits for the next second (or whatever iteration I choose) at which time it will add the new value to the running total.

 

Thanks for your input

Jake 

0 Kudos
Message 1 of 6
(4,428 Views)

Use a shift register.

Shift Register.png

Cory K
Message 2 of 6
(4,426 Views)
Solution
Accepted by topic author NXTenergy

You know, I may have just solved my own problem. I wired the instantaneous heat output value to one leg of a simple "add" function, then wired the total back into the other leg of the function. Then displayed the running total. Since everything iterates in the same timed loop, that should work for my process. 

If anybody has a better solution (or verbal abuse about the simplicity) post away.

0 Kudos
Message 3 of 6
(4,418 Views)

The Loopback function (<--) is basically a miniature shift register.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 6
(4,414 Views)

Any of the above three methods (your's included) will work fine.

Performance-wise, there will not be a noticeable difference between them, so I guess its just personal preference at this point.

Cory K
0 Kudos
Message 5 of 6
(4,412 Views)

thanks, I guess i'll go with what I've got for now. good info though!

0 Kudos
Message 6 of 6
(4,404 Views)