LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

less/greater than functions

 

looking at these functions they only have a boolean output as opposed a number output.

i'm looking at a scenario like:
if;
16 put out 16

18 or 20 put out 32.

0 Kudos
Message 1 of 10
(5,207 Views)

If you have simple enough logic you can use the Select function to output a value based on some true/false condition.

 

http://zone.ni.com/reference/en-XX/help/371361L-01/glang/select/

 

As your logic gets more complicated it might be easier to just use a case structure.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 10
(5,201 Views)

@pjh-10 wrote:

 

looking at these functions they only have a boolean output as opposed a number output.

i'm looking at a scenario like:
if;
16 put out 16

18 or 20 put out 32.


Because they do the function they were designed for, tell you whether something is less than, greater, then (or equals as well.)

 

Use a case structure as pointed out at http://forums.ni.com/t5/LabVIEW/Tab-control-and-Ring/m-p/3093407#M884876

0 Kudos
Message 3 of 10
(5,193 Views)

@pjh-10 wrote:

 

looking at these functions they only have a boolean output as opposed a number output.


And why should they?  The do the comparison.  They shouldn't do any more.  Now what you do with the results of those comparisons is completely up to you.

 

In the specific case you gave, I think you should use a Case Structure and wire the number directly into the case selector.  You can manage ranges of numbers with the case structure, which I think will do exactly what you want.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 10
(5,191 Views)

@pjh-10 wrote:

i'm looking at a scenario like:

if;
16 put out 16

18 or 20 put out 32.


  • Are these integers?
  • Are there guaranteed only three possible input values (16, 18, 20)?
  • If not, what should happen if another input is enountered (e.g. 19 or 0)
  • Where do the numbers come from?
  • Where does the output go?
  • Do you simply want to round up to the next integer power of two?
0 Kudos
Message 5 of 10
(5,184 Views)
I don't know what you are trying to accomplish, but it's clearly not a comparison. Is this a simple lookup table? Is there some math operation that defines the output? What are you trying to do?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 10
(5,141 Views)

A word length is read (it’ll either be 16/18/20)
if 16 I want to pass it on to a case structure of 16
if 18/20 onto the 32 case structure

0 Kudos
Message 7 of 10
(5,122 Views)

are you looking for something like this?

 

Case str.png

Munna
0 Kudos
Message 8 of 10
(5,109 Views)

Hi pjh,

 

either do your comparison or use those numbers as selector values!

check.png

As this is pretty basic labVIEW stuff: are you sure you have taken all those free online beginner courses offered by NI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(5,108 Views)

I'm also concerned.  When I use add, it just adds the numbers.  It doesn't tell me how many times the add primitive has been called.  Why doesn't LabVIEW tell me that?  It should know I want it to do more after it adds.

0 Kudos
Message 10 of 10
(5,068 Views)