Example Code

Flip-Flop

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

 

 

Overview: This VI is a simple implementation of a flip-flop in LabVIEW.


Description:

This program sets an LED (labeled Switch) to True when Line 1 transitions from True to False. When Switch is true, changes to Line 1 won't affect Switch until Line 2 resets Switch by transitioning from True to False. At that time Switch is turned off and can be turned on by Line 1 again.


Requirements: LabVIEW 2012 (or compatible), Hardware: none.


Steps to Implement or Execute Code:

1. Click the Run button.

2. Notice that toggling Line 2 does not affect the state of the Switch Boolean.

3. Click on the Line 1 button to put it in the True state.

4. Click on Line 1 again to cause it to transition from True to False.

5. Notice that the Switch Boolean is now set to True and that further transitions of Line 1 do not affect the state of Switch.

6. Toggle Line 2 from False to True then back to False.

7. Notice that the Switch Boolean is now set back to False.

8. At this point the VI is back to its initial state.


 

Additional Information or References:

 

Flip-Flop FP.png

 

Flip-Flop sn.png


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

Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com

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