LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring RMS value of a varying string value

Hey all! I want to measure the RMS value of a string through VISA serial communication from an AC signal. Currently if I wire the output directly to measure the RMS value, it will give values that keep changing(unstable). But if I store the values from the AC signal to an array, I'm able to get a stable RMS value. But again, if let's say I change the load and run the program again, the previous RMS value will change very slowly to the new corrected value. I think it's because the previous values are already stored in the array and the array will keep updating so it won't be fast to calculate the RMS.

What must I do? I want the values to quickly change or maybe store a specific number of values in the array and update those values?

How can I solve this?

0 Kudos
Message 1 of 4
(2,681 Views)

If you have a stream of data coming in that represents an AC signal you will need to index out single cycles of the waveform and process them individually.  If your signal is centered around zero you can search for the zero crossings to determine the start and stop of each cycle.  Then, as fast as the complete cycles are read in the serial port you will get an RMS value to display.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 2 of 4
(2,673 Views)

I would just use the RMS PtByPt.vi.  Then you do not have to keep track of your array.  You can also tell it it initialize on the first iteration of your loop to clear out the old values.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(2,633 Views)

@crossrulz wrote:

I would just use the RMS PtByPt.vi.  Then you do not have to keep track of your array.  You can also tell it it initialize on the first iteration of your loop to clear out the old values.


Good... Point!  If he knows the period he can feed in the sample size to the Point by Point VI.  If not it still seems like he has to detect and calculate it somehow in order to measure just one cycle.  I haven't made much use of the PtByPt palette yet.  I'll have to look into them...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 4 of 4
(2,566 Views)