Elementary Mathematical Functions in LabVIEW
Elementary Mathematical Functions in LabVIEW
The previous activity has focused in the development of LabVIEW program using basic arithmetic,
comparison and Boolean functions. This activity is a one-level higher continuation of Activity No. 2 which
will be focusing on the use of elementary mathematical functions of LabVIEW. The elementary and special
functions in LabVIEW include trigonometric, exponential, hyperbolic functions but not limited to discrete
mathematics, Bessel functions, linear algebra, curve fitting, interpolation, extrapolation and optimization.
LabVIEW can be used to interpret data that require the use and application of higher mathematical
operations. A number of engineering design and analysis depends on how data will be treated. Say for
instance, a set of data coming from a controlled experiment is tabulated and then plotted against the x and
y axes. The programmer then noticed that the data points obtained are scattered everywhere in the plane.
Mathematically, these data are remained untreated such that they cannot be evaluated directly by
modelling the behaviour of experiment as a mathematical equation. To easily interpret these data, curve
fitting may be employed. This means that the scattered data points may be represented closely by a
geometric function including linear, polynomial and cubic function.
Another application that a LabVIEW platform can administer is optimization. This technique is used
to select the best possible elements in a group of data depending on a given criteria. For example, a metal
can factory wants to design a can for preserved foods. Using the optimization techniques in LabVIEW the
company can decide on how much dimensions of the can will give them the minimum cost of production
with maximum capacity as much as possible.
LabVIEW also offers tools for statistics. It includes measures of central tendency like mean,
median and mode. Might as well, LabVIEW has the ability to interpret complex function, mathematical
functions containing real and imaginary elements.
To access the above functions, right-click anywhere in the block diagram windowMathematics.
All functions that are not mentioned previously are located in that menu. To use the said functions,
everyone should have a strong foundation in Engineering Mathematics including Algebra, Geometry,
Calculus, Differential Equations, Advanced Engineering Mathematics, Probability and Statistics, Linear
Algebra and Discrete Mathematics.
Page 21
ECE 100 Fundamentals of LabVIEW Programming
1. Open LabVIEW 2012 and let the Front Panel and Block Diagram windows appear. On the Block diagram
window, right-click anywhere in the empty space and choose MathematicsElementaryTrigonometric
and drag and drop the six basic trigonometric functions sin, cos, tan, csc, sec and cot.
2. On the Front Panel window, drag and drop a Knob control and connect the Knob control output node to
the input nodes of the trigonometric functions. Change the scale of the Knob control from 0 (minimum) to
3.5 (maximum). Put Numeric Indicators for the output of the corresponding trigonometric function. Save
your VI as Act3_1_1.VI
4. Consider the table below. Record the values of the six trigonometric functions for the given values below:
0.00
0.50
1.00
1.50
2.00
2.50
3.00
5. Verify using your scientific calculator in DEGREE mode the values recorded on the table above.
Question: Compare the results of the values tabulated above with the values you have computed using
your scientific calculator. Is there any difference in the value? If there is a difference, why do you think so?
6. Modify the VI such that the value on your program and scientific calculator matches without omitting the
values of control knob. Save the modified VI as Act3_1_2.VI. SCREEN-CAPTURE the Front Panel and
Block Diagram for this procedure and include it in your activity report.
1. Clear the Front Panel and the Block Diagram from the
previous activity done. Create a Front Panel VI as shown
below: Save VI as Act3_2_1.VI
2. On the Block Diagram
Window, drag and drop
Exponential functions. Right-
Click anywhere in an empty
Space, go to
Mathematics
ElementaryExponential
And drag and drop the ff:
a. Exponential
b. Exponential Arg (-1)
c. Power of 10
d. Power of 2
e. Logarithm Base-10
f. Natural Logarithm
3. Connect the Exponential function to Numeric Indicator labelled as Output 1. Connect Exponential Arg (-
1) to Numeric Indicator labelled as Output 2. Connect the other functions in their respective indicators
following the sequence from c to f in the previous page.
Page 23
ECE 100 Fundamentals of LabVIEW Programming
4. Consider the table below. Record the values for the given values below:
Input values Exponential Exp Arg (-1) Power of 10 Power of 2 Log Base Natural
10 Logarithm
0.00
0.50
1.00
1.50
2.00
2.50
3.00
3.50
4.00
4.50
5.00
5.50
6.00
6.50
7.00
7.50
8.00
8.50
9.00
9.50
10.00
Question: Explain each functions used in the calculation of the tables given above.
Question: What are the other functions under Exponential and explain each function?
Page 24
ECE 100 Fundamentals of LabVIEW Programming
1. Clear the Front Panel and the Block Diagram from the previous activity done. Create a Front Panel VI as
shown below:
2. On the Block Diagram, drag and drop the six hyperbolic functions and connect to its numeric indicator
labeled Output 1 to Output 6 respectively. The hyperbolic functions in sequence should be sinh, cosh, tanh,
sech, csch, coth respectively. Save your VI as Act3_3_1.VI
3. Consider the table below. Record the values for the given values below:
Input values sinh cosh tanh csch sech tanh
0.00
0.50
1.00
1.50
2.00
2.50
3.00
3.50
4.00
4.50
5.00
5.50
6.00
6.50
7.00
7.50
8.00
Page 25
ECE 100 Fundamentals of LabVIEW Programming
8.50
9.00
9.50
10.00
Question: Explain each functions used in the calculation of the tables given above.
Question: What are the other functions under Hyperbolic Functions and explain each function?
V. ASSESSMENT TASKS
1. What are the other Mathematics functions in LabVIEW apart from Trigonometric, Exponential and
Inverse Hyperbolic functions? Enumerate their functions and define when they can be used?
2. What is the importance of having Mathematical functions in creating a program using LabVIEW?
3. When using a trigonometric function such that you want to compute for the six trigonometric functions of
a given angle, how does LabVIEW interpret your input value?
Page 26
ECE 100 Fundamentals of LabVIEW Programming
4. Can we use the Mathematical functions of LabVIEW in the operation of an external device from the
platform itself? How and why?
VI. CONCLUSION
Page 27