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: 

Detecting Knob Events

Hello,
 
  I am using Labview 8 and I was wondering if there is a quick a dirty way to detect when a user is using and/or  released the mouse key when they are using a knob. The knob is used to set a value of a power supply and I only want to sent out the command to the power supply when the user is
adjusting the know OR when the user has finished adjusting the knob.
  I want to avoid constantly sending the commaond to the power supply when the user is not using the knob. I would like to avoid having a seperate push button that the user has to press when they have finished adjusting the knob.
 
Have a great day!
Regards,


Kaspar
0 Kudos
Message 1 of 10
(3,819 Views)
This is the perfect situation to use an event structure.  Events can be configured for mouse down, mouse up, value change, etc., all of which I think would suit your application.  If you have any questions about how to use an event structure, don't be afraid to post!
0 Kudos
Message 2 of 10
(3,814 Views)
Kaspar,

this is exactly one issue where you would use the event structure. There are many examples available, some of them in the example finder of LV.

hope this helps,
Norbert B.
NI Germany

PS.: i would have linked the help for this structure to the post, but it seems that the server is currently not available Smiley Sad
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 10
(3,809 Views)

Hello,

   Thanks for the quick response. I have never used an event structure, do you have examples of using a event structure for a knob?

 

Regards,


Kaspar
0 Kudos
Message 4 of 10
(3,800 Views)
There's an example called "Event Tracking.vi", which would show you how to use some of the parts that you would use in your application.  Search for that in example finder, and give it a try.

To adapt some of the parts in the Event Tracking.vi to a knob would be really simple.  You could just replace the slider with a knob!
0 Kudos
Message 5 of 10
(3,791 Views)
Kaspar,

here is the link i didnt manage to get yesterday. There is no exact example for a knob, but for general buttons and similar. But if you read the help, you will be able to solve the issue in a very short time Smiley Wink

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 10
(3,765 Views)
I am a bit late with my reply but I recently needed something similar;

I wanted to send a valve setting over RS232 to a massflow controller using a front panel with a dial control (0% to 100%). Typically a user clicks the dial and drags it tot the desired value. However, if I would have just used a mouse up event a command wouldalways be sent ifa user cliks the dial without changing the value.

Therefore I combined  a Mouse Up and a Value Change event using an intermediate local variable.

What the attached VI now  does is

1) wait until the user changes the dial setting andreleases the mouse
2) If  this happens do something(send a command or in this case show a dialog)


The only thing I would liketo know is if I could implement an identical behaviour without needing  the boolean control on my UI...
0 Kudos
Message 7 of 10
(3,672 Views)
Hi.  Are you just concerned with the aesthetics of the front panel?  If so, you can right click the boolean and select Advanced>>Hide Control.  If that's not what you are looking for, please post back.
Lorielle P.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 10
(3,639 Views)

I'd just like to suggest that you attempt to use only the Value Change event on your knob.  Things are usually much simpler if you can avoid having to look at mouse down / mouse up, and it sounds like Value Change is exactly what you want.

Also, to avoid flooding your instrument with commands when the user grabs the knob and drags it around very quickly, you might consider setting the increment value of the knob to a reasonable value for your application, so that every pixel of mouse movement while they've grabbed the knob doesn't cause its value to change.

Good luck!

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


@Jeff B wrote:

Also, to avoid flooding your instrument with commands when the user grabs the knob and drags it around very quickly, you might consider setting the increment value of the knob to a reasonable value for your application, so that every pixel of mouse movement while they've grabbed the knob doesn't cause its value to change.



... Or simply flush stale events by comparing the event value terminal with the actual knob value, then skip computations unless the two values are equal.

See the "selective update" example here: http://forums.ni.com/ni/board/message?board.id=170&message.id=207811#M207811

 

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