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

Monitoring and Alarming

Monitoring a process variable such as engine temperature or rotational velocity of a drive shaft is essential for automation processes; this allows for logic to be built into the control algorithm and can shut down the system if necessary. With this module, you can start monitoring an input signal (process variable) and illuminating a virtual LED in NI LabVIEW software if it surpasses a threshold.


Step-by-Step Procedure

Download the Step-by-Step Procedure PDF


Before starting this procedure, you need to complete the exercises and use the solutions in the Taking a Measurement, Using Counters and Digital I/O, and Text-Based Integration modules. You can also create a numeric control to simulate the data acquisition input.

    1. Add the Mask and Limit Testing Express VI to the block diagram
      1. Right-click on the block diagram and select Express»Signal Analysis»Mask and Limit Testing
      2. Place the Mask and Limit Testing Express VI to the right of the DAQ Assistant, within the While Loop
    2. Configure the Mask and Limit Testing Express VI
      1. Select Upper Limit
      2. Select Upper Constant
      3. Enter the appropriate value for the Upper limit constant value to trigger the alarm when the limit has been exceeded
    3. Disconnect the input to the data graph indicator, and wire this to the Signals input of the Mask and Limit Testing Express VI
    4. Wire the Tested Signals output to the input of the data graph indicator to display the original signal as well as the testing limits on the same graph
    5. Invert the output of the Passed output terminal of the Mask and Limit Testing Express VI to illuminate the LED indicator if the threshold has been passed
      1. By default, the output of this function is true if the input is within the limits
      2. Right-click the Passed output terminal and select Boolean Palette»Not
      3. Place the Not function to the right of the Passed output terminal
      4. Wire the output from the Passed terminal to the input of the Not function
      5. Right-click the output of the Not function and select Create»Indicator
      6. Resize the Passed LED indicator on the front panel to the desired size

NOTE: Controlling an external light requires an NI relay device or an external relay that can be driven by a 5 V, 8 mA digital output signal and that can complete the circuit to an external power supply that drives the light.

You can convert your DAQ Assistant Express VIs into low-level NI-DAQmx functions by right-clicking the DAQ Assistant and selecting Generate NI-DAQmx Code. The low-level NI-DAQmx API exposes more functionality and customization options for programming.

LabVIEW Example Code

Right-click on the above VI snippet and select Save Image As... Locate the file on your hard disk and click and drag the file icon onto your LabVIEW block diagram. LabVIEW automatically generates the code from the VI snippet. For more information, read VI Snippets.


Module Exercise: Monitoring and Alarming

Download the Module Exercise PDF

Exercise Goal
Use LabVIEW and the NI myDAQ device to illuminate an LED when the temperature exceeds 28 ⁰C as detected by a 10 kΩ thermistor. Before starting this exercise, you need to complete the exercises and use the solutions in the Taking a Measurement, Using Counters and Digital I/O, and Text-Based Integration modules.

Required Hardware
1- NI myDAQ
1- 10 kΩ thermistor
1- 330 Ω resistor
1- Basic LED

Things to Consider

  • Connect the LED and 330 Ω resistor in series to limit the current through the LED
  • Ensure your digital output DAQ Assistant is configured to output on the same digital output terminal as the LED is connected
  • Combine the above VI snippet from this document and the solution to the digital output exercise from the Using Counter and Digital I/O module to help achieve this result
  • Use the VI snippet from the Integrating Text-Based Programming module to convert resistance to temperature in degrees Celsius

View the exercise solution (Don’t cheat!).

Cumulative Exam:
LabVIEW and DAQ

Evaluate your understanding of LabVIEW and the basics of DAQ. This exam is recommended after you complete all of the modules for LabVIEW Basic Concepts and LabVIEW Basic Tasks. There are 26 multiple choice questions on the exam.

Take the exam


Cumulative Project:
LabVIEW and DAQ

Assess your working knowledge of building a complete system by acquiring, processing, and displaying data with LabVIEW and a DAQ device. This project is recommended after you complete all of the modules for LabVIEW Basic Concepts and LabVIEW Basic Tasks.

Start the project