LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the value of anypoint from a graph

Hi, All
How can I get the value of anypoint of a waveform from a graph, in other words,  how to get the coordinate from a graph.
There is also another problem. How to save the values of a waveform in a graph to a txt file, is there any functions can convert the waveform to data directly.
Thanks.
0 Kudos
Message 1 of 4
(3,203 Views)

To interactively obtain the coordinates of a point on a graph plot you must enable cursors on your graph and setup a callback on the control. In the callback you can use GetGraphCursor (panel, control, 1, &x, &y); to obtain X and Y values of the selected point. Take a look at samples\userint\graphcursors.prj example.

To produce a text file from your data, I suggest you use ArrayToFile function: it produces a text file already separated in columns out of a data file. The only hint is that it can manage only one input file: in case you have separate files for your data (time, measure1, measure2...) you must create a dynamic array (NumberOfPoints * NumberOfArrays) long and store your measures in this temporary array one blok after the other: ArrayToFile can be arranged so that it creates an output file of the correct format.

That is: you can produce an array this way:
meas1[0], meas1[1] .... meas1[n], meas2[0], meas2[1] ... meas2[n], meas3[0] .....

and obtain such an output:
meas1[0], meas2[0], meas3[0]
meas1[1], meas2[1], meas3[1]
...
meas1[n], meas2[n], meas3[n]

Message Edited by Roberto Bozzolo on 03-29-2006 08:23 AM



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,202 Views)
Excuse for my English, and thank you very much!
0 Kudos
Message 3 of 4
(3,197 Views)
With CVI 8.0 and higher, you can also use GetGraphCoordsFromPoint() to convert graph pixel coordinates to graph data points. See the help for that function for more information.

Bilal Durrani
NI
0 Kudos
Message 4 of 4
(3,181 Views)