You are on page 1of 7

Week-6(20331A0449)

1. Build a VI to compute the following equations using formula nodes.


y1 = x3 + x2 + 5; y2 = m*x + b;
Procedure:
 The above equations can be solved either dropping the block on to the block diagram
window or by using formula node or by formula script.

Y=(A*B*C)+(D*E)
 The equation consists 5 variables and performs two functions.
 Open LabVIEW and click on file and new vi.
 Tile the two windows i.e., the front panel and the block panel using ctrl+t.

BLOCK DIAGRAM WINDOW:


 First Right clickNumericCompound Arith.
 Drag the function for accommodating 3 inputs and create three controls A,B,C
respectively. Right click on the operator and change of operation to multiply.
 Again to multiply D*E, Right clickNumericMultiply.Create two controls D,E
respectively.
 Now , right click on the block diagramNumericAdd.
 Connect the outputs of A*B*C and D*E to the Add function by dragging the wiring
from each output to the each input of Add.
 Create an indicator the Add block and rename it as Y.

Y=mx+c
BLOCK DIAGRAM WINDOW:
 Same like the previous equation , Create a Multiply and Add functions from the
Functions palette of block diagram.
 Multiply m*x and give it as an input to the Add function and create a control as C and
connect to the other input of the Add function.
 Create an indicator the Add block and rename it as Y.

Computing the equations using Formula Node method:


 Right click on the Block Diagram WindowSelect ExpressArith &Compare Select
Formula Node.
 A Calculator like Window will appear with its variables X1,X2,X3,X4,X5….,Type the
formula in the editor with the variables present inside it. See that the indicator is green
in colour. Click ok.
 Create 5 controls A,B,C,D,E, and an indicator Y and them to their respective nodes of
the Formula node function.

Computing the equation using Formula Script:


 Right click on the front panelStructuresFormula Script.
 Drag the Script box with the respect to the number of inputs and outputs.Type the
Formula in the editor space with a semicolon(;) in the end.

Y = ( m∗x ) +C ;
 Click on the frame of the formula script and add inputs and name them x,m,c and an
output y and them with their corresponding controls and indicators.
 Select all Right clickOff the View as Icons
 From the tools palette, click brush icon for minimizing the block diagram.

FRONT PANEL WINDOW:


 Select the controls and indicators, Align them properly.
 Right click Select Decorations from controls palette and select a frame which is an
optional.
Make sure that the RUN arrow is not broken, if broken rectify the errors.
Now give the inputs and Click RUN( ).
1) Build a VI to execute the following expression using stacked sequence
structure. (A+B)/[(A+B)*2
The three cases be:
Case1: A+B
Case2: (A+B)/2

Case3: (A+B)/[(A+B)*2
A)
Aim: To create a VI that implements the given cases using stacked sequence structure.
Procedure:
1. Open blank VI.
2. Build front panel window
a. Place one control (inputs) from Controls palette -> Modern -> Numeric ->
Numeric control as A, B.
b. Place one Indicator (outputs) from Controls palette -> Modern -> Numeric ->
Numeric indicator as output.
Fig. Front panel window
3. Build block diagram window
a. Place flat sequence structure.
b. Convert the flat sequence structure to the stacked sequence structure for this
right click on the flat sequence structure -> click on replaced to stacked sequence structure.
c. Add the two frames by click on the stacked sequence structure.
d. For the case 1 Connect the input controls A, B and add function from function
palette -> Numeric -> Add.
e. Add the sequence local to the stacked sequence structure.
f. Connect the add output to sequence local.

g. For the case 2 connect the frame 1 sequence local and multiply function, add the
constant 2 from function palette -> Numeric ->Divide, controls -> Numeric -> Numeric
constant.
h. Add the sequence local to the stacked sequence structure.
i. Connect the divide output to sequence local
j. For the case 3 connect the frame 2,1 sequence locals and divide function, from
function palette -> Numeric ->Divide.
k. Connect the divide output to stacked sequence structure.
l. Make proper connections among controls, functions, and indicator.

m.

Fig. Block diagram


4. Run the VI by entering the control values and observe the output in the indicator from
the front panel window.

Results Analysis:

If the input A=8, B=5 then the output is 0.5 by using the cases Case1: A+B
Case2: (A+B)/2
Case3: (A+B)/[(A+B)*
3. Build a VI to execute the following expression using flat sequence structure.
(A+B)/[(A+B)*2] The three cases be:
Case1: A+B
Case2: (A+B)/2
Case3: (A+B)/[(A+B)*2]

A) Aim: To create a VI that implements the given cases using flat sequence structure.
Procedure:
1. Open blank VI.
2. Build front panel window
a. Place one control (inputs) from Controls palette -> Modern -> Numeric ->
Numeric control as A, B.
b. Place one Indicator (outputs) from Controls palette -> Modern -> Numeric ->
Numeric indicator as output.

Fig. Front panel window


3. Build block diagram window
a. Place flat sequence structure.
b. Add the two frames by click on the flat sequence structure.
c. For the case 1 Connect the input controls A, B and add function from function
palette -> Numeric -> Add.
d. Connect the add output to frame 1.
e. For the case 2 connect the frame 1 output and multiply function, add the constant 2
from function palette -> Numeric -> Divide, controls -> Numeric -> Numeric constant.
f. Connect the divide output to frame 2.
g. For the case 3 connect the frame 2,1 outputs and divide function, from function
palette -> Numeric ->Divide. Connect the output of divide to the output function.
h. 0Make proper connections among controls, functions, and indicator.
Fig. Block diagram

4. Run the VI by entering the control values and observe the output in the indicator from
the front panel window.

Results Analysis:

If the input A=3, B=6 then the output is 0.5 by using the cases

Case1: A+B

Case2: (A+B)/2
Case3: (A+B)/[(A+B)*2

You might also like