DC and RMS Measurements
- Updated2025-01-28
- 5 minute(s) read
Calculates the DC (mean) and/or RMS values of an input signal. You also can use this Express VI to calculate the intermediate sum, mean square, or square sum values in order to save FPGA resources. This Express VI accepts frames of data, performs measurement on the input data, and returns a valid single result for each frame.

Dialog Box Options
| Parameter | Description |
|---|---|
| Measurement Time Setup | Contains the following options:
|
| Windowing | Contains the following options:
|
| Execution Mode | Contains the following options:
|
| Measurements | Contains the following options:
|
Inputs/Outputs
input data
—
Specifies the input signal to measure. input data is a fixed-point number or integer with a maximum word length of either 32 bits if signed or 31 bits if unsigned.
reset
—
Clears all internal states when this signal is TRUE. Outside the single-cycle Timed Loop, this Express VI clears all internal states on the same call that reset is TRUE. Inside the single-cycle Timed Loop, this Express VI clears all internal states on the first cycle that reset is FALSE after reset is TRUE. Specifies whether the next data point has arrived for processing. Wire output valid of an upstream node to input valid to transfer data from the upstream node to this Express VI. To display this handshaking terminal, select Inside single-cycle Timed Loop in the configuration dialog box. Specifies whether downstream nodes are ready for this Express VI to return a new value. The default is TRUE. Use a Feedback Node to wire ready for input of a downstream node to ready for output of the current node. Note If ready for output is FALSE during a given cycle, output valid returns FALSE during that cycle. To display ready for output, select Inside single-cycle Timed Loop in the configuration dialog box.
DC
—
Returns the DC value of the input signal. Returns the sum of the input signals. Returns the sum of the squares of the input signals. Returns the root mean square value of the input signal. Returns the mean value of the squares of the input signals.
output valid
—
Returns TRUE if this Express VI has computed a result that downstream nodes can use. After returning TRUE for the previous output frame, output valid returns FALSE and waits for the next frame to complete. Wire output valid to input valid of a downstream node to transfer data from this Express VI to a downstream node. To display output valid, select the Inside single-cycle Timed Loop option in the configuration dialog box. Returns TRUE if this Express VI is ready to accept new input data. Use a Feedback Node to wire ready for input to ready for output of an upstream node. Note If ready for input returns FALSE during a given cycle, LabVIEW discards any data that other nodes send to this Express VI during the following cycle. LabVIEW discards this data even if input valid is TRUE during the following cycle. To display ready for input, select Inside single-cycle Timed Loop in the configuration dialog box. |
Refer to the support document at ni.com for more information about the accuracy of the DC and RMS Measurements VI.
DC and RMS measurements contain common error sources.
Conserving FPGA Resources
The DC and RMS Express VI can calculate the DC and RMS values of an input signal. However, some of the operations for the calculation require significant FPGA resources. You can save FPGA resources by splitting the operations into two groups that run on the FPGA VI and the host VI, respectively. In the following calculations, you can perform the operations in blue on the host.
DC = Sum/Actual number of measurement samples
RMS = sqrt(Mean square)
RMS = sqrt(Square Sum/Actual number of measurement samples)
You also can save FPGA resources if Actual number of measurement samples is a power of two.
Examples
Refer to the following example files included with LabVIEW FPGA Module.
- labview\examples\CompactRIO\FPGA Fundamentals\FPGA Math and Analysis\DC and RMS Measurement\DC and RMS Measurement.lvproj
- labview\examples\R Series\FPGA Fundamentals\FPGA Math and Analysis\DC and RMS Measurement\DC and RMS Measurement.lvproj
input data
—
reset
—
DC
—
output valid
—