IEE754 to Decimal Conversion in AB

lucifer

Member
Join Date
Nov 2003
Posts
52
Hello folks,

Need a little help. I got to convert 32 bit floating point data in IEEE 754 format to Allen Baradley SLC floating point(F8:0).

FYI,

Decimal IEEE 754
7.5 40F00000 (hex)
0100 0000 1111 0000 0000 0000 0000 0000 (32 bit binary)

Now I need to write a block to convert 40F00000 to 7.5 .

The URL below gives a quick insight but I still don't have the generalise formula.......
http://babbage.cs.qc.edu/courses/cs341/IEEE-754.html


Thanks.
 
Technically, convert is the wrong term here. The AB PLC floats are already IEEE-754 floats. You need to find a way top get the bytes into the float element.

I'm assuming you have this value as either a double integer somewhere or two consecuting 16-bit integers. The latter case is pretty easy. Use the COP (copy) command with the lower address integer as the source, the float element as the destination and a length of one.

If you have it as a double somewhere you will need to figure out how to get it into two consecutive integers in order to use the COP.

Keith
 

Similar Topics

In S7/TIA Portal, is there a function to round a real to a specified number of decimal places? e.g. If I have 22.519432 and I want to round it to...
Replies
16
Views
1,893
I am using a Micro 850E PLC (the new one with implicit messaging capability) to drive a Kinetix 5100 servo drive. The error code number on the...
Replies
7
Views
1,712
I'm using numeric input enable link tag to PLC DINT type. What I want is for the example in the panel view user will input 350.568 (and shown on...
Replies
1
Views
1,164
Hello, I have a SINT array I am receiving and one of the positions of this array contains the direction of the product. Inside the ladder...
Replies
4
Views
1,127
Hi, how do i include the fractional part of the position I set for encoder? I have an Omron PLC and using cx programmer. I need to command my...
Replies
16
Views
3,953
Back
Top Bottom