LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Area under each peak

Hello ,

 

I am acquiring a train of voltage signals from NI 9225 module placed on a cRIO 9022 controller ( the frequency changes dynamically )

our main aim is to calculate the area of each peak of voltage curve 

and have a floating average of the area.

 

this was partially achieved 😛 by using a Trigger and gate  VI to detect the sample and then integrate it then store it in a array

 

The problem is the trigger is activated only for the first peak from the original signal hence irrespective of the frequency the value inserted into the array is constant

 

Is there a possiblity to get the area under each peak ? and update within one second as the waveform gets updated every 1 second.

 

I tried to use shift registers and loop back the data but i will be calculating the area of the first peak again and again.

below attached is the modified version of the VI, in LV 2013 , and also the image of block diagram.

 

I request for your sugestions. kindly let me know if i am missing any data.

Download All
0 Kudos
Message 1 of 5
(3,066 Views)

Yes, but not with the express VIs. You will have to do the array segmentation yourself. To get started, right click on the trigger and gate express VI and select the option to open its front panel. LV will advise you that this action will convert the VI into a normal VI - which is OK. Once you have the express VI converted to a normal VI you can save it and then modify it as you would any other VI.

 

Are you using the express VIs because they are quick, or because you are somewhat inexperienced with LV?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(3,043 Views)

Hello Mikeporter,

 

Thank you for your time and reply.

 

The reason for using express is both, I am inexperienced with LV and  thought that these express VIs are pre configured and do the job.

Are they not good for health.? I mean using them is not a good practice or ? kindly suggest me so that I can enhance my future works. I am planning to use the Mask and gating ExVI for failure detection. Smiley Indifferent

 

And coming to the problem, I have followed your instructions and the changes I made to T and G edited VI is I have Hardcoded the "Reset when trigger found" to False ,expecting that it would continue to extract area after each rising edge (which I could have  done using the T and G express VI front panel also )

Though it is calculating the other peaks it has slowed down my processes

 

Am I doing it right ? If so then I have palce the VI in a Timed loop? ( and the values from the NI AI 9225 module are stored in a buffer and these are returned to host VI and then the signal analysis starts) .

If the reset thing is wrong approach, please help me with the apt way

0 Kudos
Message 3 of 5
(3,020 Views)

The problem with the express VIs is not that they are bad, but in order to create the simplified interface they have to make assumptions that might not always hold true - like for instance, the user is never going to be interested in anything but the first pulse. Often times you develop performance problems using express VIs inside loops.

 

Concerning your issue, if finding all the pulses are taking too long, there are a couple things you can do.

 

  1. Use a producer/consumer architecture to decouple the data acquisition from the data analysis.
  2. If the processing is just taking too long, implement multiple consumer loops.
  3. Optimize the finding of the pulses based on what you know about your particular application. For example, say you are sampling at a 10kHz rate and you know that the pulses are occuring at a constant 10Hz  rate. From that you can see that once you find your first pulse, additional pulses will start every 1000 samples.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 5
(3,005 Views)

Hello Mike 

 

Thank you for the guidance, So you say that if our requirements are high then it is better to avoid EVIs. I will remember that 🙂


And regarding my issue

1. Un checking the Reset after trigger will that do the job of finding all the peaks?

2. I have modified the older VI with producer and consumer loop please check If I am right ? As the update is not as expected. 

 

Guess I am asking too many questions more than my number od peaks. 😛 I apologize for that.

0 Kudos
Message 5 of 5
(2,988 Views)