Cycle Average and RMS

Returns the average and RMS levels of a selected cycle of a periodic waveform or an array of periodic waveforms. You can use this polymorphic VI to measure a waveform or an array of waveforms. The data type you wire to the signal in input determines the polymorphic instance to use.

Cycle Average and RMS 1 chan

cycle number specifies the cycle, or period, of the periodic signal on which to perform the measurement.
signal in is the waveform to be measured. Each waveform is required to contain at least cycle number complete cycles, where a cycle is defined as the interval between two consecutive rising mid ref level crossings.
reference levels specifies the high, middle, and low reference levels of a waveform. The reference levels are used to define the measurement interval of one complete cycle.
high ref level specifies the high reference level of the waveform in percent (default) or absolute units. After the signal crosses the mid ref level in the rising direction, it must cross the high ref level before the next falling mid ref level crossing can be counted.
mid ref level specifies the middle reference level in percent (default) or absolute units. The interval between consecutive rising mid ref level crossings defines one cycle, or period, of the waveform. At least one high/low reference level crossing must separate each mid ref level crossing.
low ref level specifies the low reference level of the waveform in percent (default) or absolute units. After the signal crosses the mid ref level in the falling direction, it must cross the low ref level before the next rising mid ref level crossing can be counted.
ref units specifies whether the high, mid, and low ref level inputs are interpreted as a percentage (default) of the full range of the waveform, or as absolute levels.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurs before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a non-zero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
percent level settings specify the method used to determine the high and low state levels of a waveform. percent level settings determine the reference levels when percent ref units is selected, otherwise this input is ignored.
method specifies how the high and low state levels of the waveform are computed. Available methods are auto select (default), histogram, and peak.

auto selectdetermines if the histogram bins corresponding to the high and low state levels each have over 5% of the total hits. If so, it returns those results, otherwise, it uses the peak method. This ensures a reasonable answer for either a square wave (ignoring the overshoot and preshoot) or a triangle wave (where a histogram fails).
histogram returns the levels of the histogram bins with the maximum number of hits in the upper and lower regions of the waveform. The upper and lower regions of the waveform include the upper and lower 40%, respectively, of the waveform's peak-to-peak range.
peaksearches the entire waveform for its maximum and minimum levels.
histogram size specifies the number of bins in the histogram used to determine the high and low state levels of the waveform. histogram size is ignored if the peak method is selected.
cycle average is the mean level of one complete period of a periodic input waveform. The average is computed as follows:

where i indicates the waveform samples that fall in the single period specified by cycle number, and numPoints is given by:

numPoints = int(period/dt + .5)

where dt is the time between two samples and int( ) is a function that returns the integer portion of a floating-point number.

The cycle average of a perfect sine wave is zero, while the average level of the entire waveform can be nonzero due to partial periods at the boundaries of the waveform.

cycle RMS is the root mean square value of one complete period of a periodic input waveform. The RMS value is computed as follows:

where i indicates the waveform samples that fall in the single period specified by cycle number, and numPoints is given by:

numPoints = int(period/dt + .5)

where dt is the time between two points and int( ) is a function that returns the integer portion of a floating-point number.

error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a non-zero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.
measurement info returns the measurement cycle interval endpoints and the absolute reference levels used to define the measurement cycle.
start time specifies the time of the rising mid ref level crossing that defines the start of the measurement interval.
end time specifies the time of the rising mid ref level crossing that defines the end of the measurement interval.
reference levels returns the three user-defined reference levels of the waveform in absolute units. The reference levels are used to define the one cycle measurement interval.
high ref level returns the high reference level.
mid ref level returns the middle reference level.
low ref level returns the low reference level.
ref units is always absolute in measurement info.

Cycle Average and RMS N chan

cycle number specifies the cycle, or period, of the periodic signal on which to perform the measurement.
signal(s) in is an array of waveforms containing the signals to measure. Each waveform is required to contain at least cycle number complete cycles, where a cycle is defined as the interval between two consecutive rising mid ref level crossings.
reference levels specifies the high, middle, and low reference levels of a waveform. The reference levels are used to define the measurement interval of one complete cycle.
high ref level specifies the high reference level of the waveform in percent (default) or absolute units. After the signal crosses the mid ref level in the rising direction, it must cross the high ref level before the next falling mid ref level crossing can be counted.
mid ref level specifies the middle reference level in percent (default) or absolute units. The interval between consecutive rising mid ref level crossings defines one cycle, or period, of the waveform. At least one high/low reference level crossing must separate each mid ref level crossing.
low ref level specifies the low reference level of the waveform in percent (default) or absolute units. After the signal crosses the mid ref level in the falling direction, it must cross the low ref level before the next rising mid ref level crossing can be counted.
ref units specifies whether the high, mid, and low ref level inputs are interpreted as a percentage (default) of the full range of the waveform, or as absolute levels.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurs before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a non-zero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
percent level settings specify the method used to determine the high and low state levels of a waveform. percent level settings determine the reference levels when percent ref units is selected, otherwise this input is ignored.
method specifies how the high and low state levels of the waveform are computed. Available methods are auto select (default), histogram, and peak.

auto selectdetermines if the histogram bins corresponding to the high and low state levels each have over 5% of the total hits. If so, it returns those results, otherwise, it uses the peak method. This ensures a reasonable answer for either a square wave (ignoring the overshoot and preshoot) or a triangle wave (where a histogram fails).
histogram returns the levels of the histogram bins with the maximum number of hits in the upper and lower regions of the waveform. The upper and lower regions of the waveform include the upper and lower 40%, respectively, of the waveform's peak-to-peak range.
peaksearches the entire waveform for its maximum and minimum levels.
histogram size specifies the number of bins in the histogram used to determine the high and low state levels of the waveform. histogram size is ignored if the peak method is selected.
cycle average is an array that returns the mean level of one complete period of each periodic input waveform. The average is computed as follows:

where i indicates the waveform samples that fall in the single period specified by cycle number, and numPoints is given by:

numPoints = int(period/dt + .5)

where dt is the time between two samples and int( ) is a function that returns the integer portion of a floating-point number.

The cycle average of a perfect sine wave is zero, while the average level of the entire waveform can be nonzero due to partial periods at the boundaries of the waveform.

cycle RMS is an array that returns the root mean square value of one complete period of each periodic input waveform. The RMS value is computed as follows:

where i indicates the waveform samples that fall in the single period specified by cycle number, and numPoints is given by:

numPoints = int(period/dt + .5)

where dt is the time between two points and int( ) is a function that returns the integer portion of a floating-point number.

error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a non-zero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.
measurement info is an array of clusters that returns the measurement cycle interval endpoints and the absolute reference levels used to define the measurement cycle for each input waveform.
start time specifies the time of the rising mid ref level crossing that defines the start of the measurement interval.
end time specifies the time of the rising mid ref level crossing that defines the end of the measurement interval.
reference levels returns the three user-defined reference levels of the waveform in absolute units. The reference levels are used to define the one cycle measurement interval.
high ref level returns the high reference level.
mid ref level returns the middle reference level.
low ref level returns the low reference level.
ref units is always absolute in measurement info.