Floating Point Registers + Allen Bradley

sgsims

Member
Join Date
Jun 2005
Posts
12
I am having trouble using floating point numbers. When I use the DIV function and specify an F8 register location for the output it rounds the number. Additionally I thought that foating point registers were 32 bit it looks like to me that the F8 registers are 16 bits.

What am I doing wrong?
 
What is your actual divide?
What are the operands?

INT / INT still yields an int.

If you are trying to divide a number by a constant (or a constant by a number), make the constant a float (123.0 instead of 123).

And in most AB platforms (all I work with) a float is indeed a standard 32bit approximation. To copy one, you need to copy two words (16 bit values), not just one.
 
floating points (ex: F8:such-and-such) are indeed 32-bit structures ... but they're not the same as a 32-bit integer ... page F-6 (way at the back) of this manual might help you understand them ...

if you can give us some specific examples of what values you're trying to work with, we might be able to suggest some "work-arounds" that would help ... we also need to know what platform you're working with ... some processors support different formats than others ...
 
Here is what I am trying to do with an AB simulator.

When I run this the value in F8:2 is 0 instead of the decimal value.

F8:0 is 2 trying to do 2/3
 
Trying to take an integer and divide it by an integer which will yield a floating point decimal
 
Just a question?

sgsims said:
Here is what I am trying to do with an AB simulator.

When I run this the value in F8:2 is 0 instead of the decimal value.

F8:0 is 2 trying to do 2/3

In your example wouldn't the empty rung 002 cause an error that stops the program running? I haven't used the simulators but to download to my 5/03 or 5/05 I have to verify the program first and an empty rung is not allowed. Hope this might help.
 
Last edited:

Similar Topics

I am new to using floating point registers w/ Alen Bradley products and I seem to be having some trouble getting the output I desire. Can...
Replies
4
Views
3,388
I need to check an axis actual travel position, and to compare it to the master travel position. To do this I have to multiply the axis travel...
Replies
6
Views
2,558
We have AOIs for projects, which handle material dosing (by hand or by pipes and pumps), obviously they have comparison between setpoint and...
Replies
50
Views
14,190
Hi eveyone. I need transfer signal from system 1 to DCS via modbus. System 1 only can send 32 bit floating point. DCS receive 16 bit integer. How...
Replies
20
Views
10,548
Hi, In my ladder logic, I've got a data register D60 whose value is -0.001 (when using monitor mode to see values). D406 is 0.250. But then...
Replies
5
Views
1,300
Back
Top Bottom