LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem implementing a restricted-access slider control

I want to create a front panel control which is basically a slider with a numeric display and inc / dec buttons. However, I want to prevent the user setting the control's value by clicking on the control or typing in a number (VI is controlling a machine where a large and rapid movement could cause damage). So, control of the value must be purely through use of the inc/ dec buttons.

With a conventional control, there seems to be no way to prevent the user changing the value by clicking or typing, so what I have is a slider indicator whose value is controlled by 2 switch-until-released buttons made to look like up and down arrows. On the diagram I have a loop which executes every 20ms; if a button is being held down the value is incremented or decremented.

It works fine, except that I cannot make fine adjustments to the value. What I need is an auto-repeat-after-1-second feature. I can implement this in the program by counting iterations of the loop, but I feel there has to be a more elegant way!

 

An ordinary numeric control has a built-in auto-repeat feature on its buttons, so I could possibly use a control with an indicator positioned on top of it. However, the auto-repeat rate is far too slow for my liking and I can't see any way to change it.

 

Any inspiration would be welcome! I'm writing this in Labview 7.1

 

0 Kudos
Message 1 of 3
(2,901 Views)

If you want to finely control the repeat rate then I think you've already hit the nail on the head with the need for custom code that monitors your buttons. It would probably be better to have an event structure monitor the button (seems a bit of a CPU waste to be constantly polling your buttons) but that means timing control, rather than iteration counting.

 

I like the idea of a custom repeat-rate for control increment/decrement buttons... Smiley Happy

 

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 2 of 3
(2,892 Views)

Hi there

 

"I like the idea of a custom repeat-rate for control increment/decrement buttons..."

 

Yes, me too! I agree that a event sructure would be better for monitoring.

 

Did you seen the "Data entry limits"\Increment property of numeric indicators? You could set that to e.g. 10.0 if two consecutive button clicks follow within 500ms. To avoid that the user clicks the slider i usually use a see-through flat box over the control.  

Message Edited by chrisger on 08-24-2009 10:59 AM
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Download All
0 Kudos
Message 3 of 3
(2,885 Views)