From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

horizontal slider property

Sounds like good effort on your part-

 

Sorry I got hung -up working today or I would have pointed you to the mouse up event.  Thanks for clairfing the actins you needed and good job finding a solution!


"Should be" isn't "Is" -Jay
0 Kudos
Message 11 of 15
(922 Views)

Hi Kaspar,

 

Sliders can cause problems when used as controls.

 

First, they produce events for all interim values, so if you only want to respond to a final value, you have to play games with the mouse functions and even then there are issues that you can't completely fix.

 

As you observed, using the "mouse up" event has a caveat. "Sliding" the mouse off of the control and then releasing the mouse button will result in the slider value being changed but no "mouse up" event will be fired. Now the front panel is not in sync with the program settings. In your case, your state machine will stop, but no "next test step" will be selected. Your program may appear to have hung.

 

You can also play with "mouse leave" events but in the end you still have the same issue. You can't guarantee that the value that is shown on the front panel will be the value detected by your event structure.

 

Note that this whole issue is only a problem when the user does things that are slightly out of the ordinary (i.e.. "slides" off of a control), but that is something you can't control. You can call me paranoid.

 

After spending a few hours trying to get this to work reliably I came to the conclusion that I would only use sliders for direct control when I can use the "value change" event only - and the application can handle the many interim value change events.
  
Have you considered using a text ring, or a menu ring, or using the slider as a selector and then a boolean for a "Go to Test"? (Obviously, the large number of test steps you have to display is an important consideration.)

 

Note: I just reread one of your earlier posts and noticed that you are using the slider as both a control and an indicator. This could be a problem. What happens if the user is in the process of selecting a test and the program goes to the next test in the sequence? Will the control value be overwritten? This could be confusing.

 

Here's an idea:

 

  • When a test is running, disable the slider control. Have a button that says "Stop Test".
  • When "Stop Test" is pressed - stop the test and enable the slider control. Change the button name to "Select Test".
  • Now the user can select a test number (you can use the value change event here).
  • When the user presses "Select Test" you start that test, disable the slider, and set the button back to "Stop Test"


Ok, sorry for the long post. I hope there is something helpful in here.

 

steve - one who makes simple things complex

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
Message 12 of 15
(898 Views)

Hello,

 

  Thank you for your feedback on using horizontal sliders, you are correct. I wanted to minimize the operations that the technicians have to go thru in order to change the test sequence, which is why I tried to use the horizontal slider. I have the code working and it will be interesting to see the response of the techniciians to my attempt to make their job easier. If the technicains do not want to work with the "various features" of the horizontal slider, then I will change to code to eliminate "the features" and create a multi-step process to change the test sequence that will not have "features".

 Perhaps the next release of Labview could have a horizontal slider event that could be called "Value Change Complete" that would

requires a timer value input be used to determine the "idle time" after a value change started so that the programmer can decide when someone has completed moving the slider.

  Thanks again for your help!

Regards,


Kaspar
0 Kudos
Message 13 of 15
(877 Views)

I am using two event structure in my code (state machine). In those 2 event structures,

I have handled value change event for a Boolean control.

Value change event occurred at once on the boolean is detected by 2 event structure. How can I avoid this?

 

Please help me

0 Kudos
Message 14 of 15
(628 Views)

Use one event structure. That is the typical useage. If you have the same event in multiple ones, both events will always fire.

0 Kudos
Message 15 of 15
(619 Views)