LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why will negative numbers not work with "less or equal" function?

I am attempting to look for a -40 to get a true out. Using a "less or equal" function I place a constant of -39 on y and when the x reaches -39 or the -40 the out put remains false.

0 Kudos
Message 1 of 12
(3,725 Views)

It works correctly for me.

 

Are you sure you are passing -39? Or is there rounding errors that are not showing in the control.

Is the display format of your control set to the max number of digits to show any rounding.

 

But rounding would not explain -40.

 

Create a small VI with nothing but the less than or equal funtion with it's input and output as a test case. 

Omar
0 Kudos
Message 2 of 12
(3,720 Views)
-39 is of course larger than -40, so that part is obvious. That leaves the -40 case. Are your wires blue or orange? Where do the values come from? Can you show us some code?
0 Kudos
Message 3 of 12
(3,695 Views)

works fine here.  do you possibly have the input wires crossed?

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 12
(3,691 Views)

The wires are orange. Trying to figure out how to post the code here.

0 Kudos
Message 5 of 12
(3,656 Views)

Works fine for me too in a simple vi with just this simple set up.  In the code I run the probes and  the numbers are right but the state does not change.

0 Kudos
Message 6 of 12
(3,653 Views)

Orange is doubles, which often have rounding errors. Place an indicator showing the values compared and increase the decimals shown to 15. It's common there's a 8th place decimal (or similar) causing the problem. 🙂

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 7 of 12
(3,649 Views)

sorry check that the color is like pink

0 Kudos
Message 8 of 12
(3,646 Views)

pink is string not numeric you need to convert the strings oe use numerics.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 9 of 12
(3,640 Views)

Pink also could be a cluster of mixed data types.

 

The order of the data in your cluster will effect the comparisons.

Omar
Message 10 of 12
(3,633 Views)