LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to acquire user data from a graphic (graph is a command object)?

Hello, I would like to acquire some user data but not from a simple 2D array but from a grap object.
For example, the user can define a temperature graph by moving some "predefined points" on a graph (or cursor ???) and the application reads these different points. My idea is to make the same thing than we can do on Excel when we can move the points on a graph and the array is updated.
Thank you for your help.
Alain
0 Kudos
Message 1 of 9
(2,945 Views)

Hello Alainddd,

What software are you using ? Is it LabVIEW? If yes what is your version number ?

Regards,

ClémentG
0 Kudos
Message 2 of 9
(2,931 Views)

Hello ,

Yes I use Labview 7.0. But I also have labview 8 (not yet installed on my PC).

Bye, Alain

0 Kudos
Message 3 of 9
(2,923 Views)
Alainddd,
 
You can find attached an example in LV 8.2 doing what you want.
 
Regards,
ClémentG
0 Kudos
Message 4 of 9
(2,923 Views)
Here is the same example in 7.0
ClémentG
0 Kudos
Message 5 of 9
(2,914 Views)
Thank you very much Clement for your help !
... but it is not what I want to do : I would like to modify the points of the curve by moving them on the graph. (like with Excel when you change the curve by selecting one point). After the apllication will read the different points of the new curve.
 
If you have an idea, you are welcomed.
Bye Alain
0 Kudos
Message 6 of 9
(2,910 Views)
There are several things you need to solve your problem:
  1. A way to know if the user has selected a point on your graph
  2. A way to know where that point is dragged to
  3. A way to know the user is done
  4. A way to update the graph
  5. A way to update the data
There are several ways to solve this, including cursors, but the easiest is with the event structure.  Use the MouseDown, MouseUp, and MouseMove events to give you the three pieces of information.  On MouseDown, determine if the user has selected one of your graph points.  If so, use MouseMove to determine where they put it.  MouseUp tells you they are done.  Having this information, you can use the array functions to replace that particular element in your data array (which should be in a shift register or LV2 global).  After the array is update, you need to write it to the graph to update it.  Note that you can update the graph as often as you want to give "rubber band" effects to the move (watch out for performance issues).

Good luck!  Let us know if you need more info.
Message 7 of 9
(2,893 Views)

Thank you DFGray for your help,

I am going to try your advice with an event structure... but I am not expert with that.

I will tell you if I succeed. Bye

0 Kudos
Message 8 of 9
(2,884 Views)

Hello,

Well, after 2-3 hours, I succeed. Thank you very much for your advice.

In fact, I modified an exemple named "Draw Graph with Events.vi" and everything is ok for my application !!!

Very good forum, see you soon

Alain

0 Kudos
Message 9 of 9
(2,873 Views)