LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determining Running Max and Min values

Solved!
Go to solution

please i need some help on getting my minimum value to show up i wired it the same way as my max value but the min just stays a 0 can anybody help me out i dont understand what im doing wrong. by looking at my block diagram i do not see how it is possible for me to not be getting a value in my min indicator i have attached my vi below

 

 

0 Kudos
Message 1 of 5
(6,489 Views)
Solution
Accepted by topic author delvecchi088

Add the highlighted wire.

 

Two things:

    1. This needs to run as a sub-vi if you want the Feedback nodes to be useful.
    2. See what you can find out about uninitialized shift registers.  You need to initialize the 'Min' Feedback node with the (first) random number or you'll get the default for that data type - the zero that you saw.

 

random min and max.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 5
(6,481 Views)

awesome thanks a lot!

0 Kudos
Message 3 of 5
(6,471 Views)

One more thing you need to change is to connect the "Current Min" and "Current Max" to the inputs of the feedback nodes, not the outputs - otherwise the final number is not included in the result.  Try it with 2 iterations to see.

 

Also, in general, you would want to initialise the Maximum feedback node. Here you're ok because all your numbers are positive, but that may not always be the case.

Message 4 of 5
(6,465 Views)

As an alternative, you could also use the Array Max & Min PtByPt VI. (set the sample lenght to zero to get the functionality you currently want).

Message 5 of 5
(6,443 Views)