LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Set slider values from 0 to 4 and Jump to 7 to 9 in range of 10 values in single slider

i need to set continuous slide values from 0 to4 and need to jump to 7 and from that to 9 in range of 10 values of single slider.

please get me out on this issue.

0 Kudos
Message 1 of 16
(4,598 Views)

Use an Event Structure and Value Change Event.

Either that or you could make an XControl.

0 Kudos
Message 2 of 16
(4,576 Views)

i have tried that already . i can able to move from 0 to 4 and taken a jump to 7. But, while jumping the pointer is shaking some what and stabilised later.

i need smooth transition of jumps from 4 to 7 value

 

0 Kudos
Message 3 of 16
(4,541 Views)

That's probably because sliders generate value change events every slight movement.

 

Perhaps you can do something with a Mouse Up and Mouse Leave event for that control so that it only does the checking and forcing to a new value when you finally leave the control.

0 Kudos
Message 4 of 16
(4,531 Views)

You're going to want to skip the mouse across the gap, I assume. Otherwise it's going to bounce around while it tries to move the slider back to where the mouse remains.

 

I was curious how to do this, so I made this for you:

Skip Mouse on Slider_VI.png

 

I hard-coded the horizontal mouse location (with respect to the pane) for 4 and 7. You could use the properties of the slider (bounds, scale range, etc) to figure out the pixel locations that you would use if you were to resize or move the slider or change the values away from 4 or 7.

 

This might not be exactly the functionality you were asking about, but it gives you a hell of a good start.

 

You'll have to download the VI (maybe?) instead of the snippet in order to make the hard-coded values work.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 5 of 16
(4,508 Views)

can you make vi into 2013 version so that i can check

0 Kudos
Message 6 of 16
(4,481 Views)

with mouse up and mouse leave options in addition to value change event, i am losing the option of old value which is available in value change event.

i need to compare slider value with previous value. so that i can jump to upper or lower based on old value. and also needs smooth jump.

0 Kudos
Message 7 of 16
(4,455 Views)

Store the value that is in the control on the mouse down event in a shift register.

0 Kudos
Message 8 of 16
(4,448 Views)

Here it is in 2013

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 9 of 16
(4,435 Views)

@mubin wrote:

with mouse up and mouse leave options in addition to value change event, i am losing the option of old value which is available in value change event.

i need to compare slider value with previous value. so that i can jump to upper or lower based on old value. and also needs smooth jump.


I only use the value change event to check if the value has gone between 4 and 7, then I move the mouse if necessary. This eliminates any need for the other events.

 

Looking back at my code now, you should move the VI that pulls the current mouse position to inside the case structure.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 10 of 16
(4,427 Views)