LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event for Slider Scale Change?

I need a way to fire an EVENT if the user selects the "1000" scale and enters a new value.

Also, if the user selects the "0" and enters a new value, I want the same, or a different event to happen.

I see no such event listed.  I could poll the thing, but it's not 1995 anymore, and I've got 8 sliders to watch.

I thought maybe a reference to the scale would yield something, but I don't see it.

I'm on LV 2013, but LV2017 has nothing different in this area, that I saw.

 

Any ideas?

 

 

Slider.PNG

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 12
(4,213 Views)

hi

   I think you trigger a event for value change and check for the condition of (1000 and 0) from "new value" in the event structure.

 

thanks and regards

senthil

0 Kudos
Message 2 of 12
(4,205 Views)

Not sure I follow you.

 

Changing the scale MAX or MIN does not create a VALUE CHANGED event.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 12
(4,202 Views)

It's possible to superimpose two transparent simple numeric controls to the actual max and min positions, then use their Value change events (maybe creating an XControl, I'm not very experienced with them).

Probably it's not really worthwhile.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 12
(4,190 Views)

Wired the scale ref into Reg Event Callback. This showed that there are no associated events for a scale. As you already know the actual numeric doesn't have an event.

Therefore, it seems no event exists built into LV for this.

 

Ian
LabVIEW since 2012
0 Kudos
Message 5 of 12
(4,167 Views)

You can register a key down event for the slider and it will fire as the new scale values are entered.  Maybe you could record those keystrokes and generate a user event afterwards???

aputman
0 Kudos
Message 6 of 12
(4,151 Views)

Monitor the min&max values using shift register if change occurs trigger event.

bp
0 Kudos
Message 7 of 12
(4,149 Views)

@bharathp10 wrote:

Monitor the min&max values using shift register if change occurs trigger event.


This is what he means by "I could poll the thing", which he is trying to avoid.

0 Kudos
Message 8 of 12
(4,143 Views)

This does not directly address your question, but you could set the scale.editable property to False. If they really do need to change the scale, maybe you can give them an enum with a couple different choices, like current value +/- 10, +/-100, and just 0 to 1000. I don't know what will work for your application.

0 Kudos
Message 9 of 12
(4,140 Views)

What I need to do is set the INCREMENT based on a computed value of MAX - MIN.

(That's what the customer wants).

Maybe the SPEED slider ranges from 650-750 because they're working around engine idle speed.

So the INCREMENT might be 1 in that case - using the ARROW key would bump it up by 1 RPM.

 

Or maybe they set the range to 0-4000 to do some wide-range work. I want to react to that and set the INCREMENT to 25 or 50 or something. 

 

I don't want to poll the thing - I've got 10000 things going on and that's just spending time on something that might happen once an hour on a busy day.  Not the best use of CPU cycles, which is why I wanted an EVENT.

 

I've thought of the dummy MIN/MAX controls in place of the actual scale bottom / top.  I can make that work, but I was hoping for something a bit more elegant.

 

Looks like I can't get there from here.

 

Thanks for your thoughts!

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 10 of 12
(4,136 Views)