LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

equal?-function don't give back a T, when i'm counting up to an assigned value

Hello, i'm trying to set up a voltage with GPIB and with Agilent E3644A. I wrote a program that proportional counts up to an assigned value(max. Voltage), hold this voltage for a given time and then counts down to zero. My problem is, that the program don' stop at zero, and i get back an error from the Agilent system, that i'm out of range! I've already tried to compar to an other value, but the problem is still the same. The comparison don't give back a T, always F. For the comparison i'm using the equal?-function from the Arith/Compare>>Express Comparison pallet!
Thanks for your efforts!
0 Kudos
Message 1 of 2
(2,513 Views)
It sounds like you are doing a comparison on floating point numbers and that's a big no-no. Computers translate numbers to binary and for decimals, there is not an exact conversion. The number '5.1' might actually be '5.0999999' and your comparsion will fail. You could use less than/equal to, greater than/equal, or the in range function. You could also convert all of your number to integers.
0 Kudos
Message 2 of 2
(2,506 Views)