Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Cycle Average and RMS (Not in Base Package)

LabVIEW 8.2 Help
August 2006

NI Part Number:
371361B-01

»View Product Info

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

Use the pull-down menu to select an instance of this VI.

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 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 ref level, mid ref level, 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 occurred 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 nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies 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 specifies the method used to determine the high and low state levels of a waveform. percent level settings determines 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.

0Histogram—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.
1Peak—Searches the entire waveform for its maximum and minimum levels.
2Auto select—(Default) Determines 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 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.
histogram method specifies how the high and low state levels of the waveform are computed. Currently, mode is the only histogram method available.

0Mode
reserved is reserved for future use.
cycle average is the mean level of one complete period of a periodic input waveform. The average is computed by the following equation.

where i indicates the waveform samples that fall in the single period specified by cycle number and numPoints is given by the following equation.

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 by the following equation.

where i indicates the waveform samples that fall in the single period specified by cycle number and numPoints is given by the following equation.

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 front panel indicator 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 nonzero 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.
ref 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 ref level, mid ref level, 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 occurred 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 nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies 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 specifies the method used to determine the high and low state levels of a waveform. percent level settings determines 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.

0Histogram—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.
1Peak—Searches the entire waveform for its maximum and minimum levels.
2Auto select—(Default) Determines 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 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.
histogram method specifies how the high and low state levels of the waveform are computed. Currently, mode is the only histogram method available.

0Mode
reserved is reserved for future use.
cycle average is an array containing the cycle average of each waveform in signal(s) in. cycle average is the mean level of one complete period of a periodic input waveform. The average is computed by the following equation.

where i indicates the waveform samples that fall in the single period specified by cycle number and numPoints is given by the following equation.

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 containing the cycle RMS value for each waveform in signal(s) in. cycle RMS is the root mean square value of one complete period of a periodic input waveform. The RMS value is computed by the following equation.

where i indicates the waveform samples that fall in the single period specified by cycle number and numPoints is given by the following equation.

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 front panel indicator 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 nonzero 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 containing measurement information 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.
ref 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.

Example

Refer to the Pulse and Transition Measurements VI in the labview\examples\measure\maxmpl.llb for an example of using the Cycle Average and RMS VI.

 


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit