Help - Search - Members - Calendar
Full Version: ControlLogix
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
Amanda
I am currently communicating with a micromotion through a modbus module configured in my ControlLogix PLC. I have spoke to micromotion several times and am having a hard time understanding what they are trying to tell me. They have two Integers that get sent for a particular address that should get combined into a floating point. What they are telling me is the address structure for the micromotion is 3412 and that the PLC is 1234 so I have swapped my integers. The values I am receiving back Int[0]=16544 and Int[1]=0 which when copied into a float/dint gives me 16544. However micromotion is telling me that this value in a float gives me 5.0. Any suggestions as to what I am missing?
panic mode
By swapping words you can switch between "intel" and "motorola" formats (little vs. big endian). then this should be as simple as using COP instruction to stich the two and put them into F register.
To find more about topic search the web for IEEE real (or real32) presentation of float type

here is a sample
http://www.math.byu.edu/~schow/work/IEEEFl...oatingPoint.htm

or

http://msdn.microsoft.com/library/default....t_languages.asp
panic mode
hmmm... sorry didn't notice you are using CLX but principle is the same.
i don't have PLC at hand to try it out but the two 16-bit integers
should be part of an array such as my_ints[2] and my_ints[3].
the target should be declared as a real and then you can use COP instruction....
Amanda
I've tried that and it's not quite working out that easy. I'm attempting RS tech support currently.
Gerry
Attached clip shows what you want.
Eddie Willers
QUOTE
when copied into a float/dint


Floating Point numbers (REAL datatype) and Double Integer (REAL) datatypes are both 32 bits long, but they are not the same.

REAL datatype tags in ControlLogix use the IEEE 754 single-precision format. You can read up on it and understand the whole mantissa / exponent thing if you like.

Think of that pair of INT array elements as hexadecimal, where 16544 = 0x40A0 hex.

INT[0] = 16544 dec = 40A0 hex
INT[1] = 0 dec = 0000 hex

If you were to COP both of these into a REAL datatype tag (use Length 1 in the COP instruction), the first element would go in the lowest two bytes, and the hexadecimal representation woul be like this:

REAL = 000040A0 hex

Check how that would convert to a floating point number using this website:

http://babbage.cs.qc.edu/courses/cs341/IEE...E-754hex32.html

You will see that in that order, those values translate into... well, some very tiny number.

In this order, though:

REAL = 40A00000 hex = 5.0 floating-point decimal

You could use the Swap Bytes instruction, or you could just set up the INT array elements in the right sequence before you use the COP instruction to move them into a REAL datatype tag.

mellis
Amanda,

Which modbus module are you using with your ControlLogix?

I just did a project with the ProSoft MVI56-MCM and Micromotion 2700 series. ProSoft's tech support was quite good.

If you are using the ProSoft module, the sample program makes a pretty good starting point. You should not need to swap bytes in the ladder, that option is provided in the modbus command you set up in the module UDT.

For my project, it really was as simple as:

COP
IntArray[0]
Real
1

Good Luck,

Mike Ellis
flopro
Depending on which Micro Motion Flow Transmitter you are talkiing to, you may have the ability to reorder/swap the float bytes from the transmitter side. Also, some Modbus Polling Masters/OPC Servers have a float byte swapping feature. I always have to fiddle around with byte swapping settings on Micro Motions but we only talk to MVD core processors and sometimes 9739's.
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.