LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add numbers after a trigger

Greetings,

Let me explain what I would like to do. I an taking a fixed number of samples during a trigger pulse. After I take the samples I do some data analysis and generate a number based on the data. I would like to take this number now and add it to the previous scan cycle and give me a total number. This should be repeated over and over until the user stops the program.

 

 I think I can use an array so I will investigate further how to do it.

 

Thanks

Edward  

0 Kudos
Message 1 of 8
(2,862 Views)

I guess what you need is simply a Shift Register. Right-click on the loop and select Create Shift Register.

Behaviour should be discussed in the help of the while loop.

 

Felix

Message 2 of 8
(2,852 Views)

Hi Edward,

 

Based on what you said a shift register sound like the best solution.

 

Here is a link to some training for shift registers, just in case

 

http://zone.ni.com/devzone/cda/tut/p/id/7466 (and select Module 4 - Timing and Storing Data)

 

Please let us know how this works out

Joe Daily
National Instruments
Applications Engineer

may the G be with you ....
0 Kudos
Message 3 of 8
(2,827 Views)

I would like to sample, process the data and generate a RMS value for each trigger. For Example, my trigger pulse comes in every 4 sec and i take n samples during that time. I then take the derivative and to plot a graph.  From this data i find KWH for the duration of my trigger ( 4sec). I then take another 4 sec set of data and do the same calculations, and like before i generate KWH. I would then want to take the previous KWH and add it to my New KWH. I have placed my entire pregram in a while loop so i dont thik a shift register would work.

 

Thanks

Edward

0 Kudos
Message 4 of 8
(2,813 Views)

If you want someone to look at your code, do not post a bmp file. Changing the extension to get around the ban on bmp's is frowned upon.

0 Kudos
Message 5 of 8
(2,804 Views)

Sorry about that,I did not know that it was frown upon, but now I know. I hope this one is much better. I would like the output RMS to be accumulated everytime I get a  4 sec trigger.

 

Thanks

Edward

0 Kudos
Message 6 of 8
(2,784 Views)

Hi Edward,

 

After looking at your code shift register sound like the best solution.

 

Here is a link to some training for shift registers, just in case

 

http://zone.ni.com/devzone/cda/tut/p/id/7466 (and select Module 4 - Timing and Storing Data)

Joe Daily
National Instruments
Applications Engineer

may the G be with you ....
0 Kudos
Message 7 of 8
(2,767 Views)

Here is an example of how to use a shift register to accumulate data.  It keeps a running total, which is what you are wanting to do.  Shift Registers DO work with While Loops.  In fact you need a loop to have a shift register.

 

 

 

19543iA9377AC8B729D27E

- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 8
(2,761 Views)