LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
wired

Even/Odd? comparison primitive

Status: New

I tend to use the Quotient and Remainder for determining whether a number is even or odd. It clutters up the block diagram with the primitive, a constant, and a comparison.  How about one (or two) of those nifty little triangles with a number in and a boolean out to indicate if the number is even (or odd)?  It seems I need this function more frequently than one would expect, and it would be a simple 'new feature'.

16 Comments
altenbach
Knight of NI

The problem is that if you create a dedicated primitive for each possible scenario, you get massive palette bloat. Next thing you want a primitive that checks if a number is divisble by three... :o.

wired
Active Participant

I really don't think I'd be asking for such a thing.  This idea was based on the fact that on multiple projects I have done, I would have used this primitive had it been on the palette.  Your mileage may vary...

peos
Member

To wired on:

 

If you need this function frequently, make a subVI. It can be made in half an hour, and icon editing takes 99% of the time.

 

Build your own library with such useful functions.

 

Even.png

wired
Active Participant

The same could have been said of some of the other primitives in LabVIEW.  In 20 years of LabVIEW programming, I have never used the Octal Digit? primitive (I'm not really sure when it was introduced - probably the V8 timeframe?), yet I have needed an even/odd comparison on many occasions. I would gladly exchange one for the other 🙂

David_Grucza
Member

This really comes down to how readable your diagram is (and how uncluttered it is). Making a primative out of an often used function will improve readability and clutter. So I vote that this is a great idea.

David Grucza, CLD
SteenSchmidt
Trusted Enthusiast

Just stumbled upon this old idea. Since it hasn't made it into LabVIEW yet I would point to the GPower Comparison toolset that actually contains this:

 

Comparison_Palette.png

 

/Steen

CLA, CTA, CLED & LabVIEW Champion