LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get and display max number

Solved!
Go to solution

hi

 

i want to get and display max number if i move slider up/down and should be reset if i press button.

 

Thanks,

0 Kudos
Message 1 of 14
(5,856 Views)

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.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 14
(5,844 Views)

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?

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 3 of 14
(5,839 Views)

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.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 14
(5,828 Views)
  • I have done this just want more that indicator should be reset when i press momentary button.
0 Kudos
Message 5 of 14
(5,817 Views)

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).

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 6 of 14
(5,806 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 14
(5,805 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 14
(5,800 Views)

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.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 9 of 14
(5,798 Views)

cant do that. i want that code should start getting max value again from now after i press press any button.

 

Thanks

0 Kudos
Message 10 of 14
(5,746 Views)