HomeModulesModule 1.3 (Labview Loops) → Tutorial 3

TIME TO MATCH TUTORIAL


INTRODUCTION

In this tutorial, you will create a VIS that generates random numbers until the number generated matches the number entered into a Digital Control on the Front Panel. The iteration count terminal keeps count of the iterations before the match occurs. When it does, the loop stops and the matched number and the # of iterations are displayed on Digital Indicators.

  • Start a new VI
  • Create the Front Panel and Block Diagram as shown above
  • Set the digits of precision on the Digital Control and Digital Indicators to zero (No decimal places after the decimal point)
    • Pop-up on the Control or Indicator > Format & Precision:

    • Set the Digits of Precision to Zero:
  • Run the VI, enter different values for the Number to Match and observe the results
  • Note: Do not run this VI continuously
  • Save the VI as Time_To_Match.vi

Below are some nodes that may be unfamiliar to you:

Round to Nearest function compares rounds the input number to the nearest whole number

Pop-up > Numeric > Round to Nearests

Not Equal? function compares the numbers at it's input and returns a TRUE if they are not equal; otherwise, it returns a FALSE

Pop-up > Comparison > Not Equal?

Increment function takes the number at it's input and returns that number incremented by one

Pop-up > Numeric > Increment