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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Random Number w/ Min/Max, Min stays at zero - not taking the random #s

Solved!
Go to solution

Anomalous_0-1708317197857.png

My issue is that the minimum is staying at zero, how can I get the minimum to output the first random # and then compare from there? 

0 Kudos
Message 1 of 3
(222 Views)
Solution
Accepted by topic author Anomalous

You need to initialize your shift registers.

Typically, the min with +inf and the max with -inf.

 

Else it remembers the last values between runs. On the first run, you get the default, i.e zero, which remains the min.

Message 2 of 3
(206 Views)

Also remember that we have ptbypt VIs, so your code look as follows:

 

altenbach_0-1708359594553.png

 

(Depending on the rest of the code, you might what to init if i=0)

 

Also note that your loop time is instantaneous, so the indicator terminals don't belong inside the loop.

 

0 Kudos
Message 3 of 3
(148 Views)