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: 

Is there a vertical slide with a bolean?

I know it's a strange question so I'll give my scenario.  I'm controlling a stepper motor that takes ASCII text commands.  I'd like to use one for a throttle control on a small engine.  The user would like a slider or knob for the throttle.  I can make a slide generate the numeric value now but they still have to hit a boolean to execute the command.  Is there a slide or knob that will generate the value AND then execute upon release? 
 
I hope this makes sense.  It's a simple process but difficult to put into words. 
 
Thanks
0 Kudos
Message 1 of 14
(3,101 Views)
Hi Dave,

it seems you need something like a "value change" event for that control! When the user moves the slide an event is generated and you can process this in an event structure. This way you can process the new value whenever the user moved the slide.

There's only a drawback:
Do you need this boolean to "allow" the value change? Something like: first set new value, then click on a button labeled "move now"? In this case I would use 2 controls (slide and boolean switch).

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 14
(3,097 Views)
Please try following example using a structure event and let us know if this fulfils your requirement ?
0 Kudos
Message 3 of 14
(3,094 Views)
Thanks GerdW.  The ideal thing for me would be a typical vertical slide that the user would click on to move (changing the numeric output value) that would then execute the way a button does upon release.  I currently have a similar VI with an execute button but the dual function would be cool.  I'll play with it here and see what I can do. 
0 Kudos
Message 4 of 14
(3,090 Views)

Hi Dave,

In JB's code, change the event handled by the second case to 'Mouse Up' event and it seems to do exactly what you want to do. Smiley Wink

Vikas

0 Kudos
Message 5 of 14
(3,085 Views)

I'm still working through making something like JB's VI work inside mine.  I don't fully understand yet.  It's not as intuitive to me as I'd like it but I'll get it. 

I don't understand changing the 2nd case to "mouse up".  Thanks everyone.

0 Kudos
Message 6 of 14
(3,072 Views)
I would just like to clear something before modifying the example.

What is the expected behaviour ?
  • send a command only when the value of Dial changes (like in the example)
  • send the commands continuously when the mouse is clicked on Dial
  • something else
0 Kudos
Message 7 of 14
(3,042 Views)

It is a throttle that I intend to control with a Step Motor that receives ASCII commands. 

Let's say I'm at 20% of full throttle and I want to go to 50%.  The user clicks on the slider and moves it up to 50 changing the value that will be sent to the throttle control.  When the user releases the slider I'd like it to then send the new value to the motor.  They wouldn't get instant change but it would be a little better than having to push execute after changing the value. 

I hope that helps. 

0 Kudos
Message 8 of 14
(3,030 Views)
You only need to change the event to Mouse Up like mentionned by Vikas. Please let me know if the new example behaves as expected.
0 Kudos
Message 9 of 14
(3,023 Views)
JB, one small problem occurs if the user accidentally moves outside the dial area during operation. The dial would be at the new place, but it would not update the output.
 
Here's a quick draft of a solution (LV8.2).
  1. Use a shift register that turns true on mouse down on the dial.
  2. Use a "pane: mouse up" to either update or not, depending on the boolean.

This might still need to be tweaked a bit. (The entire thing could be made into an Xcontrol).

Message 10 of 14
(3,006 Views)