08-22-2017 08:19 AM
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?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-22-2017 08:27 AM
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
08-22-2017 08:33 AM
Not sure I follow you.
Changing the scale MAX or MIN does not create a VALUE CHANGED event.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-22-2017 09:05 AM
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.
08-22-2017 10:00 AM
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.
08-22-2017 11:06 AM
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???
08-22-2017 11:11 AM
Monitor the min&max values using shift register if change occurs trigger event.
08-22-2017 11:27 AM
@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.
08-22-2017 11:30 AM
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.
08-22-2017 11:39 AM
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!
Blog for (mostly LabVIEW) programmers: Tips And Tricks