Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

How Can I Create a Rolling Average in Lookout?

Primary Software: Lookout
Primary Software Version: 5.1
Primary Software Fixed Version: N/A
Secondary Software:

Problem: I can see that using the Average object in Lookout will generate a running average over time. I need to have a rolling average that will calculate the n most recent samples of a signal, where n is a number. How can I create this continuous rolling average?

Solution: The Average object in Lookout actively calculates the average value of data over time, which gives you a running average. In order to easily create a rolling average, which continuously takes a set number of samples and calculates the average, you need to use the XBaR or XChart objects. The XBaR object graphically displays an X-Bar chart and/or an R chart for a given signal. Similarly, the XChart object graphically plots the value of an observed signal on a chart in response to a trigger signal.

With either object, the most important parameter for creating a rolling average is the Number of samples to display. When samples are taken with these objects, they are averaged and displayed up until the Number of samples to display is reached, at which time the object removes the oldest sample before plotting the newest sample and generating a new average. The datamember of interest for the rolling average value is the R_CL or CL datamember for these two objects.

In short, to create a rolling average:

  1. Create either the XBaR or XChart object
  2. Specify an "Observed Signal"(parameter) as the source of the samples.
  3. Specify an "Observed Trigger"(parameter) as the source of when samples are taken.
  4. Specify the "Number of samples to display"(parameter) as the total number of samples to average at a given time.
  5. Monitor R_CL or CL(datamembers) of the XBaR or XChart, respectively, to receive the rolling average.

For more information about these objects, refer to the Lookout Help.

Related Links:

Attachments:





Report Date: 08/28/2003
Last Updated: 11/06/2003
Document ID: 30REDQ2P

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit