Jump to content
Sign in to follow this  
Neil Pate

Setting range of slider and its digital display

Recommended Posts

I am struggling with something I would have assumed is trivial.

All I want to do is to be able to programatically set the range of a slider (and also its digital display. I had assumed the digital display would take the same range as the slider but apparently they are separate items.)

Anyway, a simple example is shown here and does not work, the Error 1192 comes from the second property node. The first property node correctly sets the slider range. I guess I am being stupid here, can anyone suggest what is wrong with my code?

image.png.3f4c48b78b7d641b4b4abcb2b486521a.png

Temperature Slider.vi

Share this post


Link to post
Share on other sites

There are 2 separate sets of limits: Scale.Maximum/Scale.Minimum and Data Entry Limits.Maximum/Data Entry Limits.Minimum.

The digital display simply shows the value stored in the Slide -- in other words, it shows what you'd see from the Slide's terminal, local variable, or Value property node. The underlying issue is that the Slide's value remains unchanged when you update the Scale limits.

The Scale limits set the visible range on the GUI but they don't set the range of allowable values. To get the behaviour you want, you don't need to use a property node on the digital display but you must:

  • Set "Respond to value outside limits" to "Coerce" instead of "Ignore"
  • Programmatically update the Data Entry Limits
Edited by JKSH
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks, I cannot believe I did not see the Data Entry Limits as part of the slider properties! For some reason the DigDisps[] property caught my attention and I thought this was the right place to go poking around. This works (as expected!).

image.png.907e04999910fb91ca960995a3f36711.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.