0% found this document useful (0 votes)
9 views

SP20-21-Introduction To LabView Com

Uploaded by

tia hajj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

SP20-21-Introduction To LabView Com

Uploaded by

tia hajj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

EECE442L – Communications Laboratory

1
Introduction to Labview Com 2.0

Department of Electrical and Computer Engineering

Faculty of Engineering and Architecture

American University of Beirut

EECE 442L – Communications Laboratory

Experiment on Introduction to LabView Com 2.0

Objectives:
Learn the following LabView Functions:

• Create a VI and sub VI


• Controls and indicators
• Case structure
• For/while loop
• Array manipulation
• Clusters
• Waveforms (build waveform, waveform properties, plot on same graph…)

Part 1: Calculating Power

1. Design and implement a VI that outputs the magnitude of the complex power |S|, the average power
P, and the reactive power Q, given amplitude voltage (Vm), current (Im), and their phases (𝜃𝜈 𝑎𝑛𝑑 𝜃𝑖 ).
For the phase, make the input in π units and add blocks to your VI to transform this input into radians
by multiplying it with π. For example, an input of 0.5 corresponds to 0.5 π that indicates a phase of 90o.

|S|=√𝑃2 + 𝑄 2 (1)

𝑉𝑚𝐼𝑚
P= cos(𝜃𝜈 − 𝜃𝑖 ) (2)
2

𝑉𝑚 𝐼𝑚
Q= sin(𝜃𝜈 − 𝜃𝑖 ) (3)
2
EECE442L – Communications Laboratory
2
Introduction to Labview Com 2.0

2.
TO DO Q1. Test your VI with different values of V and I and validate your answers.
Vm (V) 𝜃𝜈 (π) Im(A) 𝜃𝑖 (π) P Q |S|
Using Using Using Using Using Using
formula VI formula VI formula VI
5 0.25 0.002 0.0

TO DO
Q2. Add a screenshot of the front panel with the values that you got.

3. Modify your VI by adding a case structure (Figure 1) with a selector connected to a Boolean control
indicating whether the input amplitude voltage and current are in RMS.

Figure 1: Case structure VI

Tip Use the following formulas to get the RMS values:

𝑉𝑚 = 𝑉𝑟𝑚𝑠 ∗ √2
𝐼𝑚 = 𝐼𝑟𝑚𝑠 ∗ √2

4. Your front panel should look like this:

Figure 2: Front panel of getPower gvi


EECE442L – Communications Laboratory
3
Introduction to Labview Com 2.0

TO DO Q3. After modifying your VI by adding a Boolean control indicating whether the input
amplitudes are in RMS, set RMS to true and check the new resulting values for P, Q and |S|.

Part 2: Use Part 1 to plot Power Vs Phase


1. Using a sub-VI:
a. Edit the icon of the gvi of Part 1 by adding the necessary inputs and outputs to the block
(Figure 3: Editing Icon for ‘getPower’ gvi) and save it in a file whose name starts with
getPower followed by your initials. (eg: “getPower_xxx.gvi”).

Figure 3: Editing Icon for ‘getPower’ gvi

TO DO Q4. Add screenshots to the new subvi that you created and name it after your family name.
b. Open a new blank VI.
c. To be able to use the previously saved VI (getPower.gvi), you need to include it in your
project as follows:

i. Right click on the project you are working on and choose Add File.
ii. Select getPower.gvi from the corresponding directory.
d. Drag the getPower gvi from the left panel to Diagram window.
e. Add the necessary controls (input) and indicators (output).
f. Test the VI by repeating step 2 of Part 1.
2. Place a for-loop around the sub-vi, keeping the controls and indicators outside the for-loop.

Figure 4: for loop gvi

3. Change the data type of the input controls (except for RMS Boolean control) and output indicators
(except for |s| indicator) to array by right clicking on each and choosing Change to Array from the
drop down menu.

4. Use tunnels to connect the input control to the subVI inside the loop.
EECE442L – Communications Laboratory
4
Introduction to Labview Com 2.0

Tip To perform calculations on each element in an array, use auto-indexing. Right click on the
connector node and choose Auto Index Values as shown in the figure below:

5. You must store the returned values of P and Q at every iteration in an array to be able to plot it
when the for loop is done.

a. Use Insert into Array VI (Figure 5) and connect its terminals as follows:

i. New element input: the P output of the getPower gvi.

ii. Array input: is the output array of the previous loop iteration. Use shift registers to
feedback the final conditions of current loop iteration to be the initial conditions of
the next loop iteration.

iii. To create a shift register:


• Right click on the loop wire
• Choose create shift register from the drop down list.
• Connect the array input of the Insert into Array VI to the created shift register
on the left.
• Connect the output array of the Insert into Array VI to the created shift register
on the right and then to an indicator outside the for loop.

Figure 5: Insert into Array gvi

b. Repeat the previous steps to store the Q values as well. (Figure 6)

Figure 6: Insert into Array VIs and output indicators P, Q and s


EECE442L – Communications Laboratory
5
Introduction to Labview Com 2.0

6. Your front panel should look like this:

Figure 7: Front panel

7. Test by putting values 0.1, 0.2 ….0.5 in the input arrays except for current phase (put them zeros,
make sure it’s taking these zeros: shouldn’t be in light color).

TO DO Q5. Take a screenshot for the front panel and the block diagram after placing the for loop
and creating the array needed.

8. Display Q vs Phase, P vs Phase, and both of them in graph.

Tip Notice that the phase that you need to plot against is (𝜃𝜈 − 𝜃𝑖 ) as per equations (2) and (3).

a. Use Insert into Array VI and set the difference of the voltage phase and the current phase to
the input New element/Subarray of Insert Array VI.

b. Use a shift register as done in the previous step.

c. Use Built Cluster VI with its input elements set to the output array P and the output array of
the phase difference and set its output to a graph to plot P vs Phase (add the graph from the
panel first).

d. Repeat the last step to plot Q vs Phase.

e. Use Build Array VI with inputs P vs Phase and Q vs Phase and set its output to a graph to
plot both of them in one graph. Add Screenshots of the obtained graphs.
EECE442L – Communications Laboratory
6
Introduction to Labview Com 2.0

Figure 8: The output graphs

TO DO Q6. Take a screenshot of the graphs. You should upload a graph that displays Q vs. phase
and the graph that displays both P and Q on the same graph.

TO DO
Q7. Upload your VIs for the two parts.

You might also like