1. Construct a VI that converts a 2D array into a tab-delimited spreadsheet string.
Then convert the
tab-delimited spreadsheet string into a comma-delimited spreadsheet string and display both
output strings in indicators on the front panel.
2. In the MathScript Interactive Window, create a script that generates a time vector over the
interval 0 to 10 with a step size of 0.5 and creates a second vector, y, according to the equation y
= e−2t 0.3sin(t) + 0.7cos(0.1t). Then, add the plot function to generate a graph of y versus t. Type
the script in the Script Editor window and, when done, use the Save As button in the Script
Editor to save the script in the Users Stuff folder in the Learning directory. Clear the script from
the Script Editor window, and then Load the script back into the Script Editor and select Run
Script.
3. Exercise 1: Summing VI
4. (a) Make a program that lets the user input two numbers, choose an
operation (one of multiply, divide, or exponent), and display the result.
This program includes arithmetic operations and case structure.
5. (b) Modify your program to make this calculator into a SubVI with three
inputs (the two numbers and the operation) and one output, and
demonstrate that it works by using it in another program.
Exercise 2: Cosine Wave Generator
6. (a) This program should allow the user to input the amplitude and
wavelength (period), generate the specified wave from x = 0 to 10,
and plot it on a graph. Programming techniques used include arrays,
arithmetic operations, for-loops, and graphing. [Hint: The cos(x) in
LabVIEW is at Functions → Numeric → Trignometric → Sine.]
7. (b) Modify your program in Part (a) to save the result in a 2-column
spreadsheet file and plot it in Excel.
Exercise 3: Combinational Logic
8. A combinational circuit has three inputs A, B, and C, and one output Z.
The output Z is High (1) only when the majority of the inputs are High
(1). The output Z is Low (0) otherwise. Design a VI to model and
simulate this circuit. Test your circuit for (A = 1, B = 1, and C = 0) and
(A = 0, B = 0, and C = 1).
9. Hints: Draw a Truth Table. Minimize using K-MAP. Build the VI using
minimized equation.
Exercise 4: For Loop Module
10. For the equation, Y = 3X2 + 2X+ 5, design a VI using For Loop to
(a) display Y values for each value of X in an Array and (b) plot X
versus Y in a Waveform Graph when X changes from 0 to 20 in steps of
2.
Exercise 5: Matrix Analysis
11. Design a VI to solve the following sets of linear equations and
display the values of X1, X2, and X3.
12. X1 + 2X2 + 3X3 = 5
4X1 + 5X2 + 6X3 = 7
7X1 + 8X2 + 2X3 = 9
13. Question 1: Create a VI that generates a sine wave, which is
displayed on a waveform graph. The user should have the ability to
change the frequency and the amplitude of this sine wave
programmatically. A power spectrum analysis should be performed on
the sine wave and displayed on a waveform graph.
14. Question 2: Continue your analysis on the sine wave that is
being generated from your solution to Question 1 above. Determine
the positive peak value of the signal and the root mean square value of
the signal and display these numeric values on the front panel. Use a
Hanning window and a Flat Top window to perform the spectral
analysis and display both on the same waveform graph.