LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Solved!
Go to solution

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

 

 

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

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

0 Kudos
Message 2 of 6
(4,672 Views)



 SR would be a start Smiley Wink

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

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

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

@apok wrote:
SR would be a start Smiley Wink

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

0 Kudos
Message 5 of 6
(4,614 Views)
Solution
Accepted by topic author achimost

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!

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