From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Tab Control with While Loop and Event Structure Example

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

    Programming Language

  • LabVIEW G

Code and Documents

Attachment

Description

Overview

This example demonstrates how to use a Tab Control to execute different portions of code based on which tab is selected.

 

 

Description

The Tab Control has similar functionality to an Enum on the block diagram. In this example, there are four tabs. The Tab Control is wired into the Case Selector terminal of a Case Structure, and the selected Tab is the case that executes.

 

 

Requirements

LabVIEW 2012 (or compatible)

 

 

Steps to Implement or Execute Code

  1. Download the VI
  2. Click on the Run arrow

  3. Click on the different Tabs, which are labeled "Page 1", "Page 2", "Page 3", and "Page 4"

 

Additional Information or References

 Different Cases Block Diagram

1.PNG

2.PNG

3.PNG

4.PNG

 

Front Panel

FP.PNG

 

 

 

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

 

 
Sincerely,

Chris G in AE

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

Comments
cdvon
Member
Member
on

As any CLADer knows, polling a control is resource intensive and poor practice. Can an event structure be used to fulfill the same purpose?

JScherer
Member
Member
on

cdvon is right. I've added code that I feel is a better example of how to use the structure and balances best practices with understandably. Let me know if it passes muster.