LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview graphs

Solved!
Go to solution

Hello, so i am not really familiar with labview, but i am trying to make something with graphs. Is it possible to make a graph so you can move around, and the linear line just keeps going (following the function) kinda like geogebra does? This isnt my main vi, its just to try if this is possible. You see on the picture, that the line just stops, that is because my x values just go to 3 but it isnt possible to get an infinite amount of values as that would just crash my laptop.

somelabguy_0-1731936016410.png

Ty for the help

0 Kudos
Message 1 of 17
(283 Views)

@somelabguy wrote:

...  Is it possible to make a graph so you can move around, and the linear line just keeps going (following the function) kinda like geogebra does?

 


Of course! You need to capture user input, then adjust the plot accordingly. You can get/set the plot information using a property node like this: 

snip.png

And to get user input you will need an event structure which you can lean how to do here: 

 

https://www.ni.com/en/support/documentation/supplemental/06/event-driven-programming-in-labview.html

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 2 of 17
(246 Views)

@somelabguy wrote:

Hello, so i am not really familiar with labview, but i am trying to make something with graphs. Is it possible to make a graph so you can move around, and the linear line just keeps going (following the function) kinda like geogebra does? This isnt my main vi, its just to try if this is possible. You see on the picture, that the line just stops, that is because my x values just go to 3 but it isnt possible to get an infinite amount of values as that would just crash my laptop.

 

Ty for the help


All you have is a one-shot downhill VI so all it will do it graph the existing array values, then stops. (I really hoe you are not using "continuous run" mode!)

 

Please explain all your vague terms. For example what is "move around"? (change array values? Do something with the mouse? Move your chair? Something else?)

 

it almost seems to be that you just want the linear graph extend past the existing values. For that you can create a linear x-ramp and do a linear evaluation using the slope and intercept from the fit.

 

You failed to attach your code containing typical data, else I could fix it for you in 30 seconds.

 

0 Kudos
Message 3 of 17
(219 Views)

Maybe this is what you want?

 

altenbach_0-1731949844437.png

 

Since you seem to like pictures of code, I am not attaching a VI yet)

 

Note that for a linear fit, a ramp with two points would be sufficient. I typically use polynomials and once you have a curved fit, you would need to generate a sufficient ramp as shown. This is more flexible and scalable and a linear fit would just a the special case of a first order polynomial.

0 Kudos
Message 4 of 17
(214 Views)

@altenbach wrote:

Note that for a linear fit, a ramp with two points would be sufficient. I typically use polynomials and once you have a curved fit, you would need to generate a sufficient ramp as shown. This is more flexible and scalable and a linear fit would just a the special case of a first order polynomial.


Here's the more general version showing a quadratic fit. Just change the poly order to 1 for the previous (linear) result.

 

 

altenbach_0-1731950478439.png

 

0 Kudos
Message 5 of 17
(203 Views)

Hey im sorry i must have done something wrong if my vi didn't attach.

I have been also experimenting with multiple graphs in 1 now, i will put in what i have made untill now.

By move around, i mean use my cursor on the graph, to move the graph around, it is with that little menu in the bottom left of my graph display, that is what i mean. So if i move it around (move the x and y with my cursor on the graph by dragging and holding left click) and keep following the line, it just keeps going. 

I can't thank you enough already for the tips you already gave me, saved me a lot of time, couldn't find this info anywhere! The vi should be linked here somewhere now.

somelabguy_0-1731976454529.png

What i want is kinda like this app called geogebra, no matter how much i zoom out or move around, the line just keeps going and never stops. I am sorry if i am not explaining it well, english isn't my first language.

0 Kudos
Message 6 of 17
(170 Views)

By "moving around", all that's really happens is a change in the min/max of the x and y scale. A linear line does not really depend on any of that and should always show as line. Right?

0 Kudos
Message 7 of 17
(155 Views)

yea i just want it so the line doesn't stop, can you do that?

0 Kudos
Message 8 of 17
(134 Views)
Solution
Accepted by topic author somelabguy

It seems like you want to scroll through a plot of a function, which is possible. But you will have to LabVIEW which points to plot because it cannot store an infinite numbers of points (nor can any other piece of software).

 

This might get you started.

RamonG_0-1732010237648.png 

RamonG_1-1732010344262.png

 

 

0 Kudos
Message 9 of 17
(124 Views)

Hey, could you do this to my vi? I would really apreciate that. TYSM you found what i was looking for!

0 Kudos
Message 10 of 17
(113 Views)