LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Single precision numeric control

Hi

I need to make a numeric control in the range 0.1 and 0.9 with 0.1
increments. I've used a single precision number, and have set up the data
range, increments and decimal place setting as appropriate but at either
extremity the control misbehaves and does not increment properly. I think
I've must have missed something somewhere as I have this working fine for
an integer control (range 1-10, increments of 1).
Can anyone help please?

Many thanks in advance

Cheers

Bill

wsymonds@clara.co.uk
0 Kudos
Message 1 of 4
(1,629 Views)
Set maximum to 1 intead of 0.9 and then it works.

"Bill Symonds" wrote in message
news:memo.20000629191218.53151B@wsymonds.clara.net...
> Hi
>
> I need to make a numeric control in the range 0.1 and 0.9 with 0.1
> increments. I've used a single precision number, and have set up the data
> range, increments and decimal place setting as appropriate but at either
> extremity the control misbehaves and does not increment properly. I think
> I've must have missed something somewhere as I have this working fine for
> an integer control (range 1-10, increments of 1).
> Can anyone help please?
>
> Many thanks in advance
>
> Cheers
>
> Bill
>
> wsymonds@clara.co.uk




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfee
ds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
0 Kudos
Message 2 of 4
(1,629 Views)
Bill Symonds schrieb:

> Hi
>
> I need to make a numeric control in the range 0.1 and 0.9 with 0.1
> increments. I've used a single precision number, and have set up the data
> range, increments and decimal place setting as appropriate but at either
> extremity the control misbehaves and does not increment properly. I think
> I've must have missed something somewhere as I have this working fine for
> an integer control (range 1-10, increments of 1).
> Can anyone help please?
>
> Many thanks in advance
>
> Cheers
>
> Bill
>
> wsymonds@clara.co.uk

Only a hint:

don't forget, that with binary representation of floating point numbers it is
not possible to create exact 0.1, 0.2, etc... since all fractional bits are
also a (negative) power of 2. See the atached scre
enshot as a simple
example...

[Image]

Jens-Achim
0 Kudos
Message 3 of 4
(1,629 Views)
In article <395CC633.8CB7E5FB@gmx.de>, tgs.kessel@gmx.de (Jens-Achim
Kessel) wrote:

> Only a hint:
>
> don't forget, that with binary representation of floating point numbers
> it is
> not possible to create exact 0.1, 0.2, etc... since all fractional bits
> are
> also a (negative) power of 2. See the atached screenshot as a simple
> example...
>
> [Image]
>
> Jens-Achim

Thanks for that and to the other for the tip above. This is the root of
the problem. I've to make a digital control such that it behaves itself at
either extremity for the data range I need to control in. Unfortunately
the choice of representation on the screen seems limited to a simple
numeric control like the one in your picture. If I wanted to do it using a
slider I'd be stuc
k with a slider which either

a) didn't behave properly at the extremes using the increment arrows at
either end

or

b) max and min points on the slider were outside the data range which
could actually be set but could still be visually selected using the drag
slider method.

Regards

Bill

wsymonds@clara.co.uk
0 Kudos
Message 4 of 4
(1,629 Views)