Example Code

Boolean Indicator Value Change Count using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview
This VI demonstrate how to implement a count of how many distinct time a Boolean Indicator reads True

 
Description
Here is a brief description of the example:

By using a Case Structure controlled by the current boolean value and a Shift Register to store the Boolean value of the previous iteration, we can keep an accurate count of how many times the LED indicator changes from F to T.  This solution does not use an Event Structure nor any Local Variables, and is not blocking.

 

Requirements

  1. LabVIEW 2014 (or compatible)


Steps to Implement or Execute Code

  1. Download Boolean LED Count.vi
  2. Run the vi.
  3. Click the Control.
  4. The count will be displayed.

 

Additional Information or References

VI Snippet 

 Boolean LED Count 2014 NIVerified.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Ashley G.
Senior Applications Engineer | RF & Wireless Communications

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
crossrulz
Knight of NI Knight of NI
Knight of NI
on

You can do this a lot simpler by using the Boolean Crossing PtByPt.vi

Boolean LED Count_BD.png


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5