# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## How to subtract a current value from loop iteration to value from previous loop iteration

Hi,

I have a series of value getting from an experiment. It is located in the white loop section.

For example: 1   ;   3   ;  6;    9. (the last value is 9)

After running an analysis, the value (put in the loop) update to 1; 3; 6;9; 15 (the update value is 15)

Then for other run, the value (put in the loop) update to 1; 3; 6;9; 15; 25 (the update value is 25)

I want to do a subtraction between 2 last value from the loop iteration. for this case 15- 9 = 6 and then 25 -15 = 10.

Could you please tell me the way to solve this problem?

Thanks

Message 1 of 6
(2,505 Views)

## Re: How to subtract a current value from loop iteration to value from previous loop iteration

Open LabVIEW, go to Help, LabVIEW Help, click the Index Tab, type "Shift Registers", and read the Help Text.  Then write a little VI and try it out.

If this is brand new to you, for goodness sake, find some basic LabVIEW Tutorial Material and spend the time!

Bob Schor

Message 2 of 6
(2,501 Views)

## Re: How to subtract a current value from loop iteration to value from previous loop iteration

SR would be a start

Message 3 of 6
(2,470 Views)

## Re: How to subtract a current value from loop iteration to value from previous loop iteration

For a change in scenery, you could also use a feedback node. 😄

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 4 of 6
(2,444 Views)

## Re: How to subtract a current value from loop iteration to value from previous loop iteration

@apok wrote:
SR would be a start

Status report? Success rate? Solar radiation? Senate resolution? Service request? Special relativity? ...

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 5 of 6
(2,443 Views)
Solution
Accepted by topic author achimost

## Re: How to subtract a current value from loop iteration to value from previous loop iteration

Hi Achimost, this is Chris with National Instruments Applications Engineering. I know it has already been mentioned, but I wanted to provide some resources with basic information on Shift Registers. These are how we pass data between different loop iterations in LabVIEW. I would encourage looking into Stacked Shift Registers in the first link.

Passing Data Between Loop Iterations in LabVIEW

http://www.ni.com/getting-started/labview-basics/shift-registers

Shift Registers: Passing Values between Loop Iterations

http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/shift_registers_concepts/

I also had some extra time and created an example illustrating the behavior you mentioned. Reading up on the above articles will help explain what you're seeing a lot better!

Message 6 of 6
(2,408 Views)