LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot an arbitary function using graph

Solved!
Go to solution
Hei, i'm trying to plot an arbitary function using a xy-graph function


i have sucesfully plotted functions like 'x+2' or 'x^2-3' but i seems like
that program does not accept 'sin(' or 'cos(' inputs and lately i began to
notice that the plot does not respond as quickly as it should when i type
in the f(x) and hit enter.

So, my question is: Is there any better solution for my problem?
what kind of vi should i use in order to plot virtually any function i want. 🙂

0 Kudos
Message 1 of 5
(2,803 Views)

You should have look to the examples shipped with LabVIEW.

Program Files\National Instruments\LabVIEW 7.1\examples\math

see the misc.llb.

Chilly Charly    (aka CC)
0 Kudos
Message 2 of 5
(2,792 Views)
ok, i did find what i was looking for, but the example was too complicated, since i'm using labview for about 1 week or something.
i got my vi to draw any function i want, but it takes too long time, may someone knows why is that so.
still, thanks for the info.
0 Kudos
Message 3 of 5
(2,786 Views)

If you believe LabVIEW is slow, try the same thing using Excel 😄

Remember that when you use a string formula, the calculation is interpreted during execution, instead of compiled before when calculated using standard functions. This makes the calculation 10 to 100 times slower, because at each run LV as to read the formula and to convert it in processor language. What you see is not the function calculation time, it's the translation time. See the attached example where the function y = cos x + sinx*sinx is calculated and timed.

If you only want to display a graph of the equation, what you could do to improve the timing is to reduce the number of points. I think that 1000 can be considered as a kind of luxury. In most cases even 100 is exagerately large.

Chilly Charly    (aka CC)
0 Kudos
Message 4 of 5
(2,781 Views)
Solution
Accepted by topic author antoker


chilly charly wrote:

If you believe LabVIEW is slow, try the same thing using Excel 😄



          Hehe, no thanks. I'm not giving up so easy. 😉 btw, the example you attached was pretty nice, you have a point there.
         
0 Kudos
Message 5 of 5
(2,772 Views)