LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

preventing 360 degree roatation of a knob

I am a beginner with LabVIEW.  Is there a way to keep a knob control from roatating 360 degrees?  In other words, stop when the "nedle" gets to the minimum or maximum value, instead of "flipping over"?  Am I missing something simple?  I know that a slider control would behave in a manner similar to what I want the knob to behave....
 
Thanks...
0 Kudos
Message 1 of 11
(4,289 Views)
One approach to the problem is demonstrated here check out the 10 turn knob.
 
Perhaps there are others out there as well
 
 
0 Kudos
Message 2 of 11
(4,264 Views)

Actually I'm not sure that the dial behaves any differently than the slider.

For both, the pointer follows the cursor whenever the left mouse button is held down. The only difference being that with the dial, once the cursor crosses the dividing line between the max and min values then the pointer quickly flips over to the side that the cursor is on. With the slider your cursor just can't travel up far enough to wrap around to where you suddenly find that you are below it. Smiley Very Happy

I don't think you are going to be able to do anything about this - I think it's a feature.

0 Kudos
Message 3 of 11
(4,263 Views)
I tried to get a regular knob control to do this.  Actually you can but the graphics is jerky because there is no filter event applicable in this situation.  Seemed like a good use for an xControl (custom control) which is what I put together below.  Its not perfect as I am having trouble getting some of the events to work properly (like setting it as an indicator) but it does do what you want through some trickery.
 
It looks like only one knob on the surface but there are actually two.  The first one (which you can see) is an indicator and it shows all the updates and provides the data.  Overlayed on this is another, invisible knob, which is what the user controls.  When the invisible knob changes value it calculates the delta between itself and the indicator and, if the delta is within a value of 5, makes some updates.  Perhaps some enterprising individual woule like to make some improvements on my initial try Smiley Tongue
 
Note:
If you want to modiy the control itself you will need to have the Professional version of LabVIEW... Eek.  Also I made this with LabVIEW 8.0 so you would need this also...

Message Edited by Chaos on 12-29-2005 09:35 AM

Message 4 of 11
(4,231 Views)
Chaos
 
Very nice use of an xcontrol 😄
 
I really started to like XControls and have made a few myself recently. They can easily solve quite a few tricky UI problems. A good reason to upgrade to LV8.
0 Kudos
Message 5 of 11
(4,206 Views)

Hello Chaos,

 

Can you put your llb in LabView 7.1?

 

Thanks ion advance

0 Kudos
Message 6 of 11
(4,202 Views)

As Chaos explicitly mentioned, you need 8.0 because an Xcontrol was used, and that's a new feature.

One way you might be able to do this in 7 is placing a transparent control above your control, registering the mouse down event for that control and transferring the values from that control to your own. You can then use whatever logic you like to make sure that it only goes up and not down.


___________________
Try to take over the world!
0 Kudos
Message 7 of 11
(4,197 Views)
And here is a very quick example (7.0).

___________________
Try to take over the world!
0 Kudos
Message 8 of 11
(4,192 Views)
I made an example too! 😄
 
(LabVIEW 7.0)
 
 
Message 9 of 11
(4,186 Views)
Christian (Altenbach), I like your solutions.  Looks nice....
0 Kudos
Message 10 of 11
(4,181 Views)