Jump to content

Max & Min primitive with 2-D numeric arrays


David Boyd

Recommended Posts

I posted this to Info-LabVIEW a week or so ago, I'll post it here as well. This has been confirmed by NI, and appears to have been introduced in LV6i or 6.1 (so it's hardly 7.1-specific):

To produce the bug, wire 2 2-D arrays of double to the X and Y inputs of a 'Max & Min' primitive (you know, the one with the measuring cups, found on the Comparisons palette). Leave the node configured to its default mode of 'Compare Elements'. Regardless of what you enter into the arrays, the 'Max(x,y)' output terminal will return the contents of the wire attached to 'X'. The 'Min(x,y)' output is correct. This problem appears to exist for all numeric datatypes of 2-D and higher order.

Others have pointed out that BD constant arrays are not subject to the buggy behavior. Also, if the 'X' input is coerced at the node (say, because it's been changed to integer or single-precision), the behavior is OK. It appears to be some sort of buffer reuse problem.

Thanks to Jesse 'Chip' Jones for the workaround suggestion of using two nodes, and inverting the inputs and outputs of the second node to use its 'Min' output for the 'Max'.

Dave

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.