LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement 'less than' in choosing functions depending on numeric input

Solved!
Go to solution

I have a 1D array and I want to split what happens with different values

I made it so that the array outputs an element, with a scroll bar to change the element

The array is random 

 

When the element is < 512 I want A to happen

When the element is > 512 I want B to happen 

 

I've played around with case structure but what confuses me is the less than and greater than fucntion, it's output is a boolean

If it changes anything I am connectiong the the output to a multiply functino 

 

Thanks!  

0 Kudos
Message 1 of 8
(2,443 Views)
Solution
Accepted by topic author sofiakyle

Pick one.  If the value is less than 512, then the boolean is True.  Put the code for A into the true case.  Otherwise it is false, put the code for B in the false case.

 

One thing you don't say is what to do if the value equals 512.  Do you want A or B?

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 2 of 8
(2,441 Views)

I don't understand what your problem is.  Wire the boolean output of the comparison to the selector tunnel of the case structure.  It sounds like you also need to wire the original number into the case structure as well (using another tunnel).


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 3 of 8
(2,438 Views)

@sofiakyle wrote:

I have a 1D array and I want to split what happens with different values

I made it so that the array outputs an element, with a scroll bar to change the element

The array is random 

 

When the element is < 512 I want A to happen

When the element is > 512 I want B to happen 

 

I've played around with case structure but what confuses me is the less than and greater than fucntion, it's output is a boolean

If it changes anything I am connectiong the the output to a multiply functino 

 

Thanks!  


I would recommend classes or getting some books on LabVIEW to study.  A basic question like this indicates you haven't yet been able to make the transition from text-based language to LabVIEW with any confidence.  It took me a while to be comfortable with it, so I feel your pain.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 8
(2,422 Views)

Here we go off to rube goldberg land again.

 

Why is there a comparision function at all ?   !!!!!

1a.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 8
(2,416 Views)

Yeah... I got assigned this bit in a group project, so I have to try to learn all this stuff quickly, never to use it again Smiley Tongue

0 Kudos
Message 6 of 8
(2,413 Views)

@JÞB wrote:

Here we go off to rube goldberg land again.

 

Why is there a comparision function at all ?   !!!!!

1a.png


It wasn't clear whether the original poster was dealing with integers or floating point numbers.  A direct wiring of the value to the case structure may not work properly for floating point numbers.

0 Kudos
Message 7 of 8
(2,403 Views)
The question was why. There are three IEEE 754 functions to assist transforming a float into an integer. IF such a conversion was needed. This question is still unclear...it has only been indirectly asked by a person (me) who was distracted and less than direct with the question. So, more directly.

The case structure has the ability to compare the value of its selector input. Why is a compare to constant needed in this case?

"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 8
(2,390 Views)