LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a graph as a control

Solved!
Go to solution

Hello all - I'd like to use as graph as a control, not as an indicator. That is, I'd like to display a set of points on a graph and then let the user adjust them as they see fit, by dragging the points around the graph.

 

I've seen something exactly the same on my graphics card driver, where I can adjust the gamma by dragging the middle point around the graph. (see pic below)

 

I'm sure someone's done this before, but I can't find any examples, references in the firum. Any ideas, anyone?

Many thanks,
Jon.

 

0 Kudos
Message 1 of 11
(3,475 Views)

I doubt anyone has done this before. 

 

You can convert the Graph Indicator to a Control, but not change the wire and it's value.

I'm not sure how or if that would be possible.

 

Certainly would be an interesting coding challenge.. 🙂

0 Kudos
Message 2 of 11
(3,467 Views)
Solution
Accepted by topic author Tournifreak

Here is my 1st attempt after a few minutes.  Probably not perfect, but it seems to work Smiley Wink

Message 3 of 11
(3,456 Views)

Many thanks Bryan - just what I was after! 🙂

 

0 Kudos
Message 4 of 11
(3,440 Views)

No problem.

 

I figured it was at least a step in the right direction.

0 Kudos
Message 5 of 11
(3,437 Views)

@_Bryan wrote:

Probably not perfect, but it seems to work Smiley Wink



Let me clear up some misconceptions you seem to have.

 

  • In order to control cursors, the graph does not need to be a control. Keep it as indicator and remove that ugly and inefficient value property node!
  • Scalability is always important, so use loops and array operations if you need to do a similar thing (e.g. reading and setting a cursor) more than once. Imagine your code with 50 cursors, a nightmare. In my code simplications, all you need to do is change a single constant for more (or fewer) cursors. (Create them dynamically by building a cursor list (not shown))

 

 

Many improvements are still possible, this is just a simple refactor of your code.

 

(There is also shipping example that allows drawing directly on an xy graph without the use of cursors.)

Download All
Message 6 of 11
(3,423 Views)

This is why you are the man altenbach!

0 Kudos
Message 7 of 11
(3,418 Views)

Wow... I learned something today.. 
That's what I love about this forum.  There are no limits to what you can do with LabVIEW...

 

Thanks for posting the solution Bryan & Altenbach..

0 Kudos
Message 8 of 11
(3,405 Views)

I prefer to use events.

Message 9 of 11
(3,376 Views)

@paul_a_cardinale wrote:

I prefer to use events.



Could you save the vi as 8.6 or 9?  Budget cuts killed my support contracts Smiley Mad

0 Kudos
Message 10 of 11
(3,372 Views)