LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change data values by using a graph plot in Labview

Hi

 

I am currently plotting data on a waveform graph and as background to this graph I have a data related image. I would like for the user to be able to select certain data points or select a ROI in order to either rewrite the data as NaN or in case data points can be 'dragged' to take on the new value ie new position X or Y value as the on graph.

Is this at all possible within LabView  (full package)?

 

Please don't hesitate further explanation if require. I expected it to be a rather easy operation but can not find any related explanations.

 

Thank you.

 

Jack

0 Kudos
Message 1 of 9
(3,830 Views)

Attached is a VI that changes the Y position of a datapoint...

 

How it works:

A cursor with 'single-plot' attribute is set

 

When the user clicks to creates a 'mouse down' event, the position of the mouse is converted to the graph coordinates and the cursor is repositioned.  Since the cursor is set to 'single-plot' it snaps to the closest data point on the plot.

 

When the user 'unclicks' or generates a 'mouse up' event the new coordinates are converted and the Y position is used to 'replace array subset in the plot.  Since the cursor was snapped to a data point in the previous event, the VI is using the cursor index to find which data point to change.

 

On the timeout event, the plot is updated.

 

 

There may be a better way to do this, but I thought this would at least get you started on manipulating the data-set with respect to mouse movements.  In this setup, the user can actually click on any position in the graph and the nearest point will move its Y value to that point, so its not only a 'click and drag' operation.  You will probably have to play around with it till you get the action you are looking for.

 

-Jonathan

-----
LV 8.2/8.5/8.6 - WinXP
Message 2 of 9
(3,812 Views)

I am just re-reading your question....what do you mean by "select a ROI in order to rewrite the data" - what is ROI?

 

Also, the example I attached only modifies the Y position since I'm only plotting a 1-d array.  This could be modified to use an X-Y graph as well without too much work.  If you clarify what type of graph you are using, and the data format, I can modify the example accordingly.

 

-Jonathan

Message Edited by malkier on 10-29-2008 05:13 PM
-----
LV 8.2/8.5/8.6 - WinXP
0 Kudos
Message 3 of 9
(3,811 Views)

Hi Jonathan

 

Thank you for your suggestion it sounds exactly like what I am after! I tried to open your code but I can't as (I forgot to mention)  I am currently working with V8.2.1. Would it be possible for you to re-save and post the file again? Thank you in advance for doing so.

 

As for the your question regarding the ROI... In addition to moving individual data points (to which your solution sounds great) I also have in mind for the user to select multiple points in one go and then declare them NaN (Not a Number). Having an image as background to the graph I mixed up the use of Region of Interest (ROI) that you can draw on a Picture or Image with selecting multiple data points on a graph. I guess my real question is: what is the best way to select and change the 'value' of multiple data points on a graph.

 

Currently I have my data plotted on Waveformgraph's but I am very much exploring different ways of dealing with the data so I will also look into plotting the the data on a XY graph. The data is currently saved in CSV format so I can read the various columns and decide/change wether to plot 1D array or 2D array data etc. As with so many things in LabView once you have the basic concept right to do something I find it easy to develop but as I am rather new to it I can not easily seem to find the starting point for certain 'actions'. For this the forum works great!

 

Thanks again for your help it is much appreciated!

 

Regards

 

Jack

0 Kudos
Message 4 of 9
(3,782 Views)

Attached in 8.2

 

 

I'm not sure how to go about selecting multiple data points....the only way I can think of doing that is to have a start cursor and stop cursor and find all the values inbetween in your dataset.  Then maybe edit the data set in a dialog. Maybe someone else can weigh in here.

 

Hope this gets you started!

 

~Jonathan

-----
LV 8.2/8.5/8.6 - WinXP
Message 5 of 9
(3,773 Views)

Not sure what your background image is for but you can show controls of the plot.... right click on the plot area, select "visible items" and you can select controls for setting different legends. These controls work during runtime of you app.

 

If you want to show/remove a limit line or show/remove some portion of a plot see the attached pic of how its done

0 Kudos
Message 6 of 9
(3,769 Views)

Robot Very Happy Malkier, I have just stumbled onto this thread, and I was delighted to find that the vi that you posted was almost exactly what I was after. Kudos to you myfriend. I have modified the code to allow you to drag 'n' modify the data points in both the x and y directions. I thought I would post the modified code here incase it was of interest to anyone.

 

Best wishes and thanks again,

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
Message 7 of 9
(3,729 Views)

Am also in the requirement of the similar vi...But am using LV 8.0.

 

Can u pls send a copy in 8.0?

 

Thanks in advance

0 Kudos
Message 8 of 9
(3,575 Views)
0 Kudos
Message 9 of 9
(3,562 Views)