06-24-2015 08:41 PM
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.
06-24-2015 09:04 PM - edited 06-24-2015 09:15 PM
I got correct results in all the cases. I used LabVIEW 2014 (32-bit).
Post your Results (if your getting NG)
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).
06-24-2015 09:16 PM
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)
06-24-2015 09:21 PM
I see the bug in LV 2014 SP1 without the f1 patch.
06-26-2015 12:34 AM
Bug is also there in the 64 bit version. (14.0.1)
07-08-2015 02:03 PM
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
07-08-2015 02:17 PM
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> ---'
07-08-2015 02:48 PM - edited 07-08-2015 02:54 PM
@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
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 array
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)
07-08-2015 03:09 PM
Thanks for the information Jeff, I did not bother to look at the indices of the returned values.
Cheers,
mcduff
07-08-2015 06:18 PM
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.