09-14-2010 07:38 AM
Hello All,
I am using knob control with its digital display to allow the user to set the parameter value. So the user can set the value either by knob control or its digital display control. I am using event structure to capture the value change. I donot have any problem when the user uses digital display control to set the value. But when the user uses knob control to set the value, I am getting multiple values at the output. But I need to have only final value to be outputted. (I donot want to seperate the events as mouse up and value change)
Please provide your suggestions
Thanks in advance
09-14-2010 08:05 AM
can you post your code for us to look at?
09-14-2010 08:12 AM
Hi Kumar NI,
@Kumar NI wrote:
Hello All,
... But when the user uses knob control to set the value, I am getting multiple values at the output. ...
you mean you get more events in a shorter time? What do you realize with this Knob? Do you directly trigger some hardware?
In this case you can use the mouse leave event to get the lase value, or you measure the time how long the value wasn't changed, or you use an additional button.
Hope it helps.
Mike
09-14-2010 08:19 AM
How about something like this?
Instead of using the digital display of the knob, put a numeric indicator and the knob in a classic cluster (classic so you can hide the border/background and make it look like it's not in a cluster).
Put the events Knob: Mouse Up and Digital Display: Value Change in the same event case. Use the ctrl reference to find the value of the object that triggered the event, use that value to update the indicator as well as update the control.
This way you still only use one event case.
The Refnum Cluster 2 is supposed to be a reference to 'Cluster'... not sure why the snippit changed it.
Front panel:
09-14-2010 08:22 AM
Hm, when reading the behavior, i would say: works as intended.
A knob of a boxed instrument does not work in another way. It also does "encounter" all the steps in between until the user stops turning the knob. So i would say: you have chosen the wrong control if you do not want to have those "interim-values".
Mike posted a workaround you can go with, nevertheless.....it is a workaround, not a solution.
Norbert
09-14-2010 08:27 AM
The easiest solution for a knob is to compare the NewVal terminal to the control's terminal. If they're equal, it's the last event. If not, you can do nothing. This works because the control's terminal always holds the current value.
09-14-2010 09:03 AM
Hello All,
Thanks for your suggestions. Here attached the sample code to understand my problem clearly.
In the VI, I want to display the final value in the string output when the user changes the knob value.
09-15-2010 12:11 AM
Hello Experts,
Do we have any solution to the above problem. Please provide your suggestions.
Hello Tim, I posted the sample code for your referrence.
Thanks
09-15-2010 12:17 AM
Hi Kumar NI,
can you please explain what do you think is the "problem". I see only expected behavior.
Which result do you need if the knob is used?
Mike
09-15-2010 12:36 AM
Hi Kumar,
Take a look at this...