LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Al.B

Improve "equal to 0" VI for use with other data types

Status: Declined
Functionality already exists in LabVIEW. There are primitives for each datatype for logical checks. Rolling all of those into one polymorphic VI could have implications on upgrading legacy code.

Currently, the "equal to 0" and "not equal to 0" VIs provide a clean way to check whether a number (or array of numbers) is 0, but I often find myself wanting the same thing for other data types.  This VI should adapt to other types which have an obvious "nothing" value, such as:

 

1.png

String - ""

Path - <not a path>

Boolean - false

Refnum - <not a reference>

etc...

Al B.
Staff Software Engineer - TestStand
CTA/CLD
5 Comments
S_Kamath
NI Employee (retired)

Seems like it would be a recipe for confusion and there are comparable functions to do each of those anyway


Explicit VIs or primitives exist for:

Empty String

Empty Array

Not a Number/Path/Refnum

 

One rarely changes between these datatypes so the adapt functionality is not really necessary and we avoid confusion regarding what =0 means for these datatypes.

Al.B
NI Employee (retired)

I do know this is possible using the "equal?" VI, but I would like to not need drop extra constants on the BD if I'm just checking if somethnig is empty.  

Al B.
Staff Software Engineer - TestStand
CTA/CLD
Knight of NI

You are not dropping extra constants. Those functions work the same way as Equal. And I agree that doing this would cause too much confusion.

G-Money
NI Employee (retired)
Status changed to: Declined
Functionality already exists in LabVIEW. There are primitives for each datatype for logical checks. Rolling all of those into one polymorphic VI could have implications on upgrading legacy code.
AristosQueue (NI)
NI Employee (retired)

Look in the same palette as the Equals Zero primitive. The other comparison tests that you are seeking can be found there.