« Close

Datasheets and User Guides

App Notes

Software & Driver


14.1.4 RMS



  • RMS_Flex 10
  • RMS_Auto 11


Min Firmware:  1.0124


RMS calculates the true RMS voltage of a signal connected to an analog input. Peak-to-peak voltage, DC offset (average voltage), and period (1/frequency) of the analog waveform are also calculated.

Internally this extended feature uses Stream-Burst (stream mode with a nonzero STREAM_NUM_SCANS) to acquire the data set and thus stream rules apply:

  • Range is controlled by the normal AIN range registers.
  • Single-ended or differential is controlled by the normal AIN negative channel registers.
  • Settling time is controlled for all channels by the special stream register STREAM_SETTLING_US.
  • ResolutionIndex is controlled for all channels by the special stream register STREAM_RESOLUTION_INDEX.  The default value of 0 corresponds to ResolutionIndex=1, and only indexes 1-8 are supported (high-res Pro converter not supported in stream).


Auto and Flex:

There are two versions of the RMS function, RMS_Flex and RMS_Auto.

RMS_Flex uses registers to specify the number of samples to collect and the frequency at which to collect those samples. The LabJack will then use the entire data set to calculate RMS.

RMS_Auto will collect samples for more than one period and attempt to find a period within the data set. The LabJack will then compute RMS only for the detected period's period.



The frequency of sample collection, number of samples collected, and hysteresis (RMS_Auto only) can be set to tailor the RMS function to the signal that will be measured.

RMS_Auto needs the values for frequency and number of samples need to be selected so that the sample time is an even number of periods. Sample time in seconds is the sample frequency divided by the number of samples. For a 60 Hz signal the period is 16.7ms, using 6000 Hz and 100 samples = 100 / 6000 = 16.7ms. The maximum possible sampling time is 180 ms.

RMS_Auto needs the sampling time set so that 1.5 to 4 periods will be observed. The hysteresis value also needs to be set to control the sensitivity of period detection.


CONFIG_A: Number of samples to be acquired. (default=200, max=16384)

CONFIG_B: Hysteresis (default=100, 16-bit counts). The smallest step (analog voltage in binary) that will trigger period detection when using RMA_AUTO. Larger values will better reject noise. Smaller values can increase the accuracy of the period calculation.

CONFIG_D: ScanRate - The frequency at which samples will be collected.



Stream-burst is used to acquire the specified number of samples at hardware timed intervals. The true RMS is then calculated using the following piece-wise math:

( (Σ(Point^2)) / numPoints ) ^0.5

The accuracy of this calculation depends on the number of samples per cycle.  Smooth waveforms will not require many samples per cycle, but waveforms with lots of harmonic content will require more samples per cycle.


Configuration Registers:

CONFIG_A: NumScans (default=200, max=16384)
CONFIG_B: Hysteresis (default=100, 16-bit counts, RMS_Auto only)
CONFIG_D: ScanRate (default=6000)


Result Registers:
READ_A: RMS Voltage
READ_B: Peak-to-Peak Voltage
READ_C: DC Offset Voltage (Average)
READ_D: Period (Seconds)








dbinger's picture

Please add an explanation of the Hysteresis CONFIG_B value.

LabJack Support's picture

Updated the description for Hysteresis.