7.traffic Light PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

DEPARTMENT OF INSTRUMENTATION ENGINEERING

AIM: To create VI to simulate traffic light control using sequence structure.


APPARATUS: COMPUTER WITH LABVIEW SOFTWARE
THEORY:
A sequence structure is used when we require some program to be executed in
sequential order. A sequence structure is used to force calculations to take place in a defined
sequence.

Sequence structures can be used to force code to execute in a specific sequence. The code
to be executed sequentially is entered on sub diagrams called frames.

Following functions are used to implement Student database:


Sr. No Function Symbol Description
1 Flat The Flat Sequence structure, shown as
Sequence follows, displays all the frames at once and
structure executes the frames from left to right and
when all data values wired to a frame are
available, until the last frame executes.The
data values leave each frame as the frame
finishes executing.
2 Boolean Boolean can be a scalar, an array, a cluster
of Boolean values, an array of clusters of
Boolean values, and so on. If Boolean is an
error cluster, only the status parameter of
the error cluster passes to the input terminal.

3 Boolean Use this constant to provide a value of


Constant TRUE or FALSE to the block diagram.
Sr. No Function Symbol Description
4 Local Local variables transfer data within a single
Variable VI and allow data to be passed between
parallel loops. Local variables let you
access front panel objects from more than
one location in a single VI.

5 Time Delay Specifies how many seconds to delay


running the calling VI. The default is 1.000.

PROCEDURE:

1. Create a new VI.Right-click on the front panel to display the Controls palette.
2. On the Controls palette, navigate to Modern »Boolean and drag the 3 Boolean
onto the front panel.
3. Place a flat sequence structure by select Programming→Structure→Flat
Sequence.
4. Add frames to the existing frame by right clicking on frame → Add Frame.
5. After 3 frames are created, place 3 LED lights (Go in front panel, right click and
select Boolean and select 3 round LED indicators) in each frame. The colors of
LEDs can be changed by going in its respective properties. Select appropriate
colors for each LED.
6. Use local variables to make the LED glows till a certain time per second.
7. To create a local variable, right-click the desired front panel object and select
Create >> Local Variable.
8. Appropriate time delays are used to see step by step response.

Conclusion: Thus a VI is implemented traffic light control using sequence structure.

You might also like