MECH 430 - Process Instrumentation and Measurement Assignment II
MECH 430 - Process Instrumentation and Measurement Assignment II
Assignment II
Instructions:
Make sure to submit a separate VI for each problem.
The VI should be named with your AUBnet name (e.g. nk64) followed by the problem number (i.e.
nk64_assignment2_problem1).
Zip all the files into a single file. The filename should be in the same format as before (e.g.
nk64_assignment2).
Problem 1:
Write a LabVIEW program that will randomly generate an integer in the range 1 to 10, and guides you in
correctly guessing the integer. When the VI is running, the user will type his/her guessed integer into the
Guess control and then click on the OK Button labeled Enter Guess. The program should display a
feedback about the guess (e.g. too low, too high, correct) in the Message indicator.
The program keeps running until the user guesses the number.
Problem 2:
a) Plot on an XY-graph two functions:
1. 𝑌 = 0.2𝑥 + 1 for 𝑥 = 0 to 10 with increments of 0.1
2. 𝑍 = 5𝑠𝑖𝑛(𝑥) for 𝑥 = 0 to 10 with increments of 0.1
b) Find the points of intersection between these two plots and display them in two array indicators
(the first array shows the x-values and the second array shows the y-values). [For the two
functions given you should have a total of four elements in the arrays since there are four points
of intersection – see figure below]
An easy approach to finding the point of intersection is to locate the instances where one line
crosses over the other. One approach is shown below:
Problem 3:
Write a VI whose front panel has an array of five Round LED labeled 0 through 4, as shown below.
Develop a program that lights these LEDs one at a time in the order 0-1-2-3-4, and keeps repeating this
sequence until the Stop Button is clicked. Make each LED stay lit for 0.2 second, so that an entire 0-1-2-
3-4 sequence occurs once every second. When the Stop Button is pressed all LEDs should turn off before
the program ends. DO NOT USE LOCAL VARIABLE.
Have fun.