Help - Search - Members - Calendar
Full Version: IEEE float help request via PM
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
Alaric
I received the following PM.

QUOTE
I am having some dificulty with trying to communicate 32 bit floats to and from the device (IEEE756) I was wondering if you have a conversion program that will take two 16 bit registers and combine them into a IEEE Float and a program that would take a IEEE Float and place them into two 16 bit registers.

My hardware is 5/04 processor communicating to a SST profibus card. I can take care of the Endian issues but this float (sign/Exponent/Mantisa) is driving me bonkers.





Sincerly

Ron I am having some dificulty with trying to communicate 32 bit floats to and from the device (IEEE756) I was wondering if you have a conversion program that will take two 16 bit registers and combine them into a IEEE Float and a program that would take a IEEE Float and place them into two 16 bit registers.

My hardware is 5/04 processor communicating to a SST profibus card. I can take care of the Endian issues but this float (sign/Exponent/Mantisa) is driving me bonkers.

Sincerly

Ron


Greetings Ron,

I've placed this reply in the open forum so that others can see it and benifit as well as making it visible to forum searches. Open forum post generally get better answers as well as faster answers.


No special program is required. The COP instruction is all that you need.

Copy F8:0 into N7:0 and N7:1: COP #F8:0 #N7:0 2
To copy N7:0 and N7:1 into F8:0 COP #N7:0 #F8:0 1


Ronny_resistor
QUOTE(Alaric @ Apr 22 2008, 03:34 PM) [snapback]68106[/snapback]

I received the following PM.

QUOTE
I am having some dificulty with trying to communicate 32 bit floats to and from the device (IEEE756) I was wondering if you have a conversion program that will take two 16 bit registers and combine them into a IEEE Float and a program that would take a IEEE Float and place them into two 16 bit registers.

My hardware is 5/04 processor communicating to a SST profibus card. I can take care of the Endian issues but this float (sign/Exponent/Mantisa) is driving me bonkers.





Sincerly

Ron I am having some dificulty with trying to communicate 32 bit floats to and from the device (IEEE756) I was wondering if you have a conversion program that will take two 16 bit registers and combine them into a IEEE Float and a program that would take a IEEE Float and place them into two 16 bit registers.

My hardware is 5/04 processor communicating to a SST profibus card. I can take care of the Endian issues but this float (sign/Exponent/Mantisa) is driving me bonkers.

Sincerly

Ron


Greetings Ron,

I've placed this reply in the open forum so that others can see it and benifit as well as making it visible to forum searches. Open forum post generally get better answers as well as faster answers.


No special program is required. The COP instruction is all that you need.

Copy F8:0 into N7:0 and N7:1: COP #F8:0 #N7:0 2
To copy N7:0 and N7:1 into F8:0 COP #N7:0 #F8:0 1



I just tried this and it works. I spent hours looking through the AB web-site Thank you for your quick reply Looks like I can spend the night moving forward. Why is this so poorly documented. I searched the Internet and found only descriptions but nothing that said here's how you do this. I checked Modbus, Profibus they all have this issue with moving 32 bit values.

Anyway once again I thank you for coming to my plight.

Sincerly

Ron
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.