LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph Cursor Question

I have a cursor on a XY-graph that I'm trying to adjust (x position) via controls on the front panel.  I have one control that works great and adjusts one number at a time (ex. 500 to 501, etc).  I'd like to have two controls one like I have that would be a fine adjustment (I believe) and another for coarse adjustment that would adjust the value by 50 or whatever.  Hence this would be adjusted first (ex 550) and then the other control would be adjusted for fine tuning (ex to say 551 etc). 
 
I'm having trouble figuring this out, and was hoping someone could giv eme some tips or ideas as to what to do.  I thought this might be something fairly common, but maybe not.
 
Thanks in advance...
 
Using Labview 7.0 and 2010 SP1 with Windows XP and 7.
0 Kudos
Message 1 of 11
(3,688 Views)
Just use two controls and sum them for the cursor placement. You can set the increment of the course control so it jumps by a defined amount.
 
The attached (LV 7.0) shows one possibility.
 
You could even set the fine control to zero whenever the course control is moved. Modify as needed.

Message Edited by altenbach on 01-18-2006 09:16 AM

Message 2 of 11
(3,685 Views)

Thanks Altenbach, that was easier than I thought.

One question though, how do you do this, just in case I want to do it, as you mentioned: >>You could even set the fine control to zero whenever the course control is moved.<<

Thanks again for your help, I appreciate it.

 

 

 

 

Using Labview 7.0 and 2010 SP1 with Windows XP and 7.
0 Kudos
Message 3 of 11
(3,673 Views)
Just write a local variable to the fine control whenever the course control changes. 🙂
Message 4 of 11
(3,667 Views)

Thanks again Altenbach.  After looking over your code, I thought that's what you meant but I just couldn't recall how to do it off hand.  That seems to do the trick.  I might have another question in regards to this soon, there's still something I need to test out, but either way I'll let you know.

 

Thanks again for your help as always, I appreciate it.

Using Labview 7.0 and 2010 SP1 with Windows XP and 7.
0 Kudos
Message 5 of 11
(3,648 Views)
It looks like I do have another question after all.  I'd like to take the second example that was posted and expand on it, which is where I'm having my troubles at.  I'd like for the cursor position indicator to pick up the location of the cursor (display its value).  Then also I would be able to use the fine adjustment to change wherever the cursor is if needed.  Either way I'd still be using the controls or just dragging the cursor, but the indicator would display the location.  I can't seem to quite figure out how to get this done and was hoping I'd find help here again.
 
Thanks in advance...
Using Labview 7.0 and 2010 SP1 with Windows XP and 7.
0 Kudos
Message 6 of 11
(3,631 Views)
What about just displaying the cursor legend? Do you also know that the cursor control there is capable of both slow and high speed movement. If you hold down the shift key, it rapidly increments/decrements. It works just like the increment/decrement buttons on the regular numeric controls.
Message 7 of 11
(3,619 Views)
That's interesting.  I may have to go that route, however I already have my controls in place (numeric controls) which fit better for display purposes in my application.  I was hoping to figure out a way to use the controls I already have to just use the fine adjustment to move the cursor itself, much like the cursor legend control does, but instead using my controls.  My setup is like the example posted, just with numeric controls instead of sliders.  If it can't be done, I guess I can go the legend route, but I'd like to take a shot at it this way first, I'm just confused about how to do it.
Using Labview 7.0 and 2010 SP1 with Windows XP and 7.
0 Kudos
Message 8 of 11
(3,609 Views)
LabVIEW 8.0 would make these things much easier, because we have events for cursor movements! :D.
 
In LabVIEW 7.0, you need to code around it. For example, you could place the cursor reads into a timeout event which is only active when the mouse is down on the graph (enable timeout with mouse down, disable with mouse up event).
 
The attached shows one simple possibility (I don't think you need the course control).
Message 9 of 11
(3,607 Views)

I tried to reply a few minutes ago, but I don't think it went through correctly....

This seems to be yet another reason why I wish I could upgrade to 8.0, and this seems to only be a "minor" thing.

Anyway, thank you yet again Altenbach for your example.  Glancing over the code and trying it out, it seems to do what I would like.  However, I dod have one question to ask of you.  Where would the corse control go i nall of that and how would it need to be coded now?  I'm not sure about that in relation to what you have.  I believe we'd like to keep it, at least for the time being.  If it's easy to explain how it could be done, maybe I can do it, or if it's not too much trouble could you modify the example again? 

Then again, if the code is getting out of hand for just this, maybe I should go with the cursor legend suggestion, but we just like using the numeric controls I have now.

Anyway, thank you again for all of your help.

 

Using Labview 7.0 and 2010 SP1 with Windows XP and 7.
0 Kudos
Message 10 of 11
(3,594 Views)