1. Insert the EMANT300 Read Digital Bit.VI to read the state of the switch. As the switch is connected to D3, we set the bit address=3. When the switch is open, an internal pull up resistor at the input pulls the voltage to 5V and therefore the VI will return T. If the switch is closed, the VI returns F.

  2. Insert Shift Register

    Right-click the left or right border of the While loop and select Add Shift Register from the shortcut menu. To add the second element, right click on the left shift register and select Add Element

    From LabVIEW Help

    Use shift registers on For Loops and While Loops to transfer values from one loop iteration to the next. You can create multiple shift register terminals on the left side of a loop to remember more than one previous value.

    The Shift register is unique to LabVIEW because it is a graphical programming language and dataflow determines the sequence of the program. Without the shift register, it would be impossible for previous values in a loop to be stored and used in subsequent iterations.

    In our solution, the shift register is used to store the state of the lighted LED. In normal operation, the switch is not closed and the Green LED is turned on. This means that

    D0 = T, D3 = T and the right shift register is T.

    iteration

    n-2

    n-1

    n

    n+1

    n+2

    n+3

    n+4

    right shift register

    T

    T

    F

    T

    T

    T

    T

    D1

    T

    T

    T

    F

    T

    T

    T

    D2

    T

    T

    T

    T

    F

    T

    T

    D0

    F

    F

    F

    T

    T

    F

    F

    D3

    T

    T

    F

    X

    X

    T

    T

    Suppose at iteration n, the switch is closed. The 2 subsequent iterations see the F state cascaded to the left shift registers and D1, D2. D0, the Green light will be lighted up only when both the Red and Yellow LEDs are off as the result of the NAND operation.

  3. Insert Nand from Functions->Boolean palette

  4. Insert Or from Functions->Boolean palette

  5. Insert Time Delay from Functions->Time & Dialog palette. Set the delay to 0.5s

Learn LabVIEW DAQ Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |