LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to add vertical line at a specified location in waveform?

Hi,all!I made an array by generating 50 random numbers,
they can be shown in a waveform.then i calculated the average of them.There must be a number in the array which value is the nearest to the average.I want to add
a vertical line at the location where is the nearest number.Is that possible?
The attached file is an incomplete vi.
0 Kudos
Message 1 of 6
(3,368 Views)
Hi!

I don't know if you can plot a vertical line. Me, to display this, I use cursors without allowing drag.
Hope this will help you.
Nico
Message 2 of 6
(3,368 Views)
Could you please give me an example?
0 Kudos
Message 3 of 6
(3,368 Views)
Well I don't have any example but I can try to explain you the way to do it.
First of all, you have to define one or more cursors in the cursors legend menu (right click on your graph, visible, cursor legend).You can choose the disign of each cursor.In your case choose no line, no point and don't show name.
To display a vertical line on your graph programmaticaly, use graph property node (see help to use property node). With this, you can acces all the cursors properties, and so, you can change the design...to see it on your graph.

Tell me if you have still any problem
Nico
0 Kudos
Message 4 of 6
(3,368 Views)
> I don't know if you can plot a vertical line. Me, to display this, I
> use cursors without allowing drag.
> Hope this will help you.

Another way to plot a vertial line is to use inf or -inf in the
waveform. A two point waveform a (x,y) of (3.5, 0) (3.5+dx,inf) will
draw a vertical line from (3.5,0) upwards to the edge of the graph. It
doesn't matter what dx is. Substituting -inf for inf should draw the
line down. Placing one of these after the other should result in a
vertical line from top to bottom. While on this topic, Nan should
result in a gap in the plot.

Greg McKaskle
0 Kudos
Message 5 of 6
(3,368 Views)
Since I was looking for the same thing (vertical line):
How does one access the properties of _different_ cursors
in one graph if there is more than one cursor?

Olaf
0 Kudos
Message 6 of 6
(3,368 Views)