LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I add current value to existing values over a period of time?

Solved!
Go to solution

Sorry guys, I'll apologize in advance since I think this problem may be very simple, but I had been mind blocked from going through hours of Labview Tutorial and trying it out.

 

Lets say I am working on a workout analyser, and everytime the z-axis fall below 0, I would count it as '1 count', I wanted to add up the total number of counts. Do I use an array to store the 'count'? I try using shift register and it only gives me the current count plus the previous, i.e. I get 2 everytime I do a count.counterror.png

 

 

Message 1 of 5
(2,367 Views)

Is it possible to create a local variable to store them instead?

0 Kudos
Message 2 of 5
(2,365 Views)
Solution
Accepted by topic author Yourong

If you just want a count, then a scalar value should be what you put into the shift register, not an array.

 

If the condition is true, add one to the value in the shift register and put it back in.  If the condition is false, then just put the current value in the shift register back in.

 

0 Kudos
Message 3 of 5
(2,351 Views)

Thanks, you are the best 🙂

0 Kudos
Message 4 of 5
(2,339 Views)

Absolute kudos for going through hours of training and tutorials.  You are still going to have questions!  If you ever learn everything about anything ... tell me all about it!

 

So, the big question is why you would evaluate one condition as "A = +1 " and another as "B = -1."   There aren't a few more conditions you can consider?  What about thowing two die plus six with an agility of +7?

 

Did I make the point clearly?  What you do depends on what you want to do and your experince.  Your code offers little for us to evaluate your end means.  -  and your end means are not stated! 

 

What is the "Z Axis?"  what are X and Y? what if any, relationship would you like them to have with the user?


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(2,332 Views)