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.
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.
09-21-2017 09:07 AM
hi
i want to get and display max number if i move slider up/down and should be reset if i press button.
Thanks,
Solved! Go to Solution.
09-21-2017 09:30 AM
Max number of what? Two values? An array?
On array palette, there is an Array Max & Min VI.
On the comparison palette, there is a Min/Max function for comparing two numbers.
Can you be more specific? Show some code.
09-21-2017 09:31 AM - edited 09-21-2017 09:33 AM
Show us the code that you have so far for this. Show us the slider along with its range. Show us your approximate front panel layout.
This is a learning/teaching experience and not just a free code sight. Are those your only requirements? How quickly should it read the slider value? How will this code exit as the requirements so far, only offer a reset option and not a Stop?
09-21-2017 09:36 AM
LOL this is the way he operates. Extracting info is like extracting a tooth. I have my own idiosyncrasies when asking a question: Like I always have incredible amounts of info - except what the forum needs to t-shoot the problem. Go figure.
Soon enough, we will have something to work with. 🙂
09-21-2017 09:42 AM
09-21-2017 09:46 AM
When you press the button, the loop stops. So after the loop, you can write a value to the indicator or you can create an invoke node for the indicator (Reinit to Default).
09-21-2017 09:47 AM - edited 09-21-2017 09:49 AM
Hi Asif,
display max number if i move slider up/down and should be reset if i press button.
All you need are:
- a shift register
- the MinMax function
- a select function, connected to your "reset" button
- a numeric constant to set the default max value
Done!
Edit:
Just saw your latest message: You're half way done!
You might have a look at the Pt-By-Pt-MinMax function!
09-21-2017 09:48 AM
Then add the button and use a Select? function to set the max to 0 when the button is TRUE and keep the max value when FALSE. You could also use a Case Structure so that the Max & Min is not ran at all when the button is TRUE and you just wire the current value through for the max value.
09-21-2017 09:49 AM
If by "reset the indicator" you mean to reset the state of the button (on or off), change the mechanical action of the button to be a latch rather than a switch. This is done on the front panel by right clicking the button.
09-23-2017 01:13 AM
cant do that. i want that code should start getting max value again from now after i press press any button.
Thanks