From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

knob loop

How do I prevent a knob ring cell from rolling over when using the incrimentors? In my picture I would like to be able to use the incriment button, but if I incriment from the top, or decrement from the bottom have nothing happen. To be clear I don't want to be able to loop directly from 100 ns to 10 ms on this setting. Also, is there a way to set a property to limit what value the knob can output? For instance flip a switch and have properties in a case structure that would say "This can only output 100 ns to 500 ns".

 

Thanks.

0 Kudos
Message 1 of 10
(3,531 Views)

I don't see a setting for that. I like to use an event structure, and that way you could filter out the events that you don't want (i.e. increment back to beginning).

0 Kudos
Message 2 of 10
(3,510 Views)

Plese attach an actual VI instead of a picture.

What is a "knob ring cell"?

You can define data entry limits for knobs and you can also prevent jumps.

0 Kudos
Message 3 of 10
(3,493 Views)

I'm fairly certain that's an enum control.  Might be a listbox.

 

If your version of LabVIEW is recent enough then there should be a property node called "DisabledItems[]" that you can pass an array of indexes to.  Whichever indexes you pass to it won't be selectable from the enum list any more on that particular control.  You could use that to exclude selections not currently supported.

0 Kudos
Message 4 of 10
(3,477 Views)

In the simple .VI below I would like to prevent jumping from 100 ns to 10 ms (going all the way around) when using the incriments on the digital display (what I called the ring cell before). In the case structure I would like to be able define a property such that the value could only be 0-2 (100 ns to 500 ns).

 

I didn't see any properties that would control this.

 

Thank you.

0 Kudos
Message 5 of 10
(3,472 Views)

You could use In Range & Coerce to limit the range that you write to your indicator.  For the control, just set the Max and Min properties.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 10
(3,438 Views)

@crossrulz wrote:

For the control, just set the Max and Min properties.


However, if you use the increment/decrement buttons, it will still wrap to the min once you try to go above the current max etc.

 

I would just hide the increment/decrement buttons and let the user chose exclusively by clicking on it.

0 Kudos
Message 7 of 10
(3,395 Views)

I set the max and min properties I can about so that using the incrimentor doesn't allow for certain values. I don't see an option for disallowing jumps however. I would like to keep the increment buttons visible because they are quite useful, but if that is the only way to prevent jumping then so be it.

0 Kudos
Message 8 of 10
(3,373 Views)

Perhaps you should hide the buttons and then create your own buttons that don't loop around at the end of the list.  Maybe disable and grey out the button in question when it is at one extreme or the other.

0 Kudos
Message 9 of 10
(3,348 Views)

In the Value change event for the control, check old and new value, if it goes from last to first or the other way around discard it/set it to end value.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 10
(3,291 Views)