HomeModulesModule 1.4 (Labview Waveform Charts) → Tutorial 2


TEMPERATURE RUNNING AVERAGE TUTORIAL


INTRODUCTION

In this exercise, you will create a VI that will monitor a simulated current temperature along with the average temperature on a waveform chart. It will employ a while loop and shift register to do this. Added elements to the shift register will store temperature data from the past few iterations to calculate the average from.

  • Create a New VI
  • Add a while loop to the Block Diagram
  • Wire a Boolean Stop Control and a Boolean NOT function to the conditional terminal
  • Add two Digital Thermometer Sub VIs; one inside the loop and one outside
    • The Digital Thermometer that is outside the loop is only read once at the beginning of the first iteration and is only used to initialize the register to about 80 Deg F
    • The Digital Thermometer is a pre-made VI used here as a Sub VI
      (SubVIs will be discussed in a later module)
    • You add it by popping-up in the Block Diagram > Tutorial > Temperature:

  • Add a Shift Register to the loop
  • Add four additional Elements to the Shift Register
  • Add a Wait (ms) function to the Block Diagram and make it so that the loop iterates every 1/2 second
  • Add a Waveform Chart to the Front Panel
  • Set the Y Axis of the Waveform Chart to Autoscale
    • Select the waveform chart in the Front Panel > Pop-up > Y Scale > Auto Scale Y:

    • Add the Waveform Chart's Digital Displays by selecting the Waveform Chart > pop-up > Visible Items >Digital Display:

  • Add Free Labels to the Waveform Graph Digital Displays
    • Select the Edit Text Tool on the Tools Palette > select the location for the text next to the digital displays > type the text > click Automatic Tool Selection on the Tools Palette
  • Modify the X and Y scale Label and Waveform Chart Label text to read as shown in the above example
  • Add a Compound Arithmetic function to the Block Diagram and Expand it to have five Inputs
    • Pop-up in the Block Diagram > Functions > Numeric > Compound Arithmetic
    • Drag and stretch the Compound Arithmetic icon to include more inputs:
  • Add a Divide Function and wire a Numeric Constant with a value of five to the loop
  • Add a Bundle Function to the Block Diagram
  • Complete the wiring as shown in the above example
  • Run the VI and observe the results
  • Save the VI as Temperature_Running_Average.vi