SP20-21-Introduction To LabView Com
SP20-21-Introduction To LabView Com
1
Introduction to Labview Com 2.0
Objectives:
Learn the following LabView Functions:
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.
𝑉𝑚 = 𝑉𝑟𝑚𝑠 ∗ √2
𝐼𝑚 = 𝐼𝑟𝑚𝑠 ∗ √2
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|.
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.
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:
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.
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.
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.
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).
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
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.