LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array max min bug LV 2014 SP1 f1

Problem

Array Max & Min returns incorrect Min under specific circumstances

 

Steps to Reproduce

The Array Max & Min function returns the Minimum value at the Max output terminal under
specific circumstances: When the Min Index(es) output IS wired and Min Value IS
NOT wired. Attached VI illustrates the problem.

 

Work around

Wire the "Min Value" output of the function even when not required.

 

It has been reported to NI. They know about it but no CAR yet.

Array Max Min Bug.png

0 Kudos
Message 1 of 12
(4,595 Views)

I got correct results in all the cases. I used LabVIEW 2014 (32-bit).

 

Post your Results (if your getting NG)

 

Max Min NG.png

 

 

EDIT:

When I checked your snippet, there is no error.

But when I checked your VI,It is showing Min value at Max Value_2.

But when I removed & reconnected, It is showing correct value (i.e. Max Value).

Munna
0 Kudos
Message 2 of 12
(4,576 Views)

That is most interesting - a bug introduced in a service pack?  Here is what I get in 2014 SP1 f1.  I wonder if anyone can try it in SP1 (no f1 patch)

Array Max Min Bug FP.png

0 Kudos
Message 3 of 12
(4,566 Views)

I see the bug in LV 2014 SP1  without the f1 patch.

0 Kudos
Message 4 of 12
(4,558 Views)

Bug is also there in the 64 bit version. (14.0.1)

0 Kudos
Message 5 of 12
(4,489 Views)

I am using 32 bit LabVIEW 2014 SP1f1.

 

Not sure this qualifies as a bug, but at least for me it is unexpected behavior. Take an array of NaNs, see snippet, you get an answer of 0 for min and max. I was expecting NaN. For example if I add 1 + NaN in LabVIEW I get NaN. I was assuming that min and max would give NaN. Maybe this can be added to the eventual CAR.

 

Cheers,

mcduff

 

MinMaxBug.png

0 Kudos
Message 6 of 12
(4,391 Views)

Are you able to recreate the error on your computer, or are you able to fix it by re-wiring like others here have mentioned? I wonder if it's a bug with your native and we're just seeing the bug when we open your code, but the bug is fixed when our own compilers reload the native.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 7 of 12
(4,384 Views)

@mcduff wrote:

I am using 32 bit LabVIEW 2014 SP1f1.

 

Not sure this qualifies as a bug, but at least for me it is unexpected behavior. Take an array of NaNs, see snippet, you get an answer of 0 for min and max. I was expecting NaN. For example if I add 1 + NaN in LabVIEW I get NaN. I was assuming that min and max would give NaN. Maybe this can be added to the eventual CAR.

 

Cheers,

mcduff

 

MinMaxBug.png


NaN values would be excluded from min and max comparisons (After all there value really is "Not A Number)  in your snipette note that the min and max indices are " -1" meaning neither a min or max value exists in the array so you get the default value for the data type 0.

 

wiring an array into array min max and testing for index <0 is actually a fairly fast way to test for an all NaN arraySmiley Wink


 

Playing with the bug:  all Floats exhibit the trouble INT and FXT types are not affected.  (Floats with defined min max behaviors of cours- complex floats just don't play into the subject at all)


"Should be" isn't "Is" -Jay
Message 8 of 12
(4,364 Views)

Thanks for the information Jeff, I did not bother to look at the indices of the returned values.

 

Cheers,

mcduff

0 Kudos
Message 9 of 12
(4,347 Views)

To follow up because there are some new comments.  It looks like CAR 530158 was filed in early June to describe this behavior if you want to follow it to see if the behavior is fixed in future releases.

Matt J | National Instruments | CLA
0 Kudos
Message 10 of 12
(4,316 Views)