RSLogix Double Precision Addition

dkennedy

Member
Join Date
Aug 2006
Location
Cork,Ireland
Posts
3
Hi All,

I am reading in four 16 bit signed numbers over modbus into four memory locations in RSLogix 5000. This is the value for the Standard Volume from a flow computer that I want to read from. According to my documentation they are of Double precision (Most Significant Bit First).

My problem is that when I do a MOV from these addresses into Integer variables and then just do an add on the 4 Integers it doesnt equate to
the volume value on the flow computer!

I take it the MOV command is formatting them someway so I just need a workaround for this.

If ye need to see some figures attached is a pic of the reading in from the Modbus memory locations into Integer variables.The values of these added should be 2667.82 (as read from flow computer) but I cant seem to get that number out (maybe they are two 32 bit numbers,if that matters??).Even if there isnt a command do perform this, just the maths to do it would suffice for me.

Any ideas would be great even though I wont be able to test them till next week when on site. There is bit of pressure on me too as I am new to this.

Cheers
David
 
Last edited:
First, you need to find out if they are actually 'Double Precision', which would generally mean a 64 bit floating point value, or if they are some other representation.

The ControlLogix can deal with single (32 bit) precision floating point values, as well as 32 bit integer values. You can handle any size integer value, actually, with loss of resolution, but anything other than 32 bits for a float will be a major headache.
 
In order to help further really we need to know exactly the format and meaning of your four source words is, and in what exact form to you want the final destination. In the meantime consider:

1. The MOV command always converts the source data into the same format as the destination address.

2. The COP by contrast does a "binary copy" of the word from the source to the destination.
 
More Info

Thanks for the very quick reply.In the documentation I have been given it
shows the address

07032 1B78H STR01 NVOL DAILY TOTAL Double (MSB 1st)

and says that its 4 addresses per item and the next item begins at 07036.

Attached is a calculator that I found that converts integers to binary
and i put the integer value from one of the registers (16558) in to see
if the binary number in my registers was the same.I highlighted where
my binary number can be seen in the output so hopefully this will help ye to see what format im using and maybe how to add the 4 registers.

Thanks
David
 
Going from 07032 to 07036 implies to me that this is actually either a single precision floating point value (32 bits), or a double integer value (again, 32 bits).

Floating point and integer are still not the same representation, so what are you actually expecting? If it's floating point, create a float register, and do:

BTD HIGH_WORD_INPUT 0 FLOAT_REGISTER 16 BTD LOW_WORD_INPUT 0 FLOAT_REGISTER 0

(Note, I prefer using BTD to move bits around than the copy instruction in cases like this).
 
Thanks very much for all your help to date.

Well,I think I might be getting somewhere.I have managed at least
to mimic the numbers that are on the flow computer using an online calculator but now all I need is for RSLogix5000 to do it.Again,

The 1st register contains the integer value 16548 = 40A4 Hex
The 2nd register contains the integer value -10041 = D8C7 Hex
The 3rd register contains the integer value -20972 = AE14 Hex
The 4th register contains the integer value 31457 = 7AE1 Hex

Now, when I combine the Hex values: 40A4D8C7AE147AE1
and place them in this form

http://www.markworld.com/showfloat.html

where it says "double-precision IEEE number as 16 hex digits"
and hit convert out pops the decimal equivalent 2668.388 which
is what is on the flow computer.

Now,any ideas on how to get RSLogix5000 to perform this calculation and I will be sorted.

Also,I dont really understand how to perform this tip.Im only used to ladder logic at the moment.

"BTD HIGH_WORD_INPUT 0 FLOAT_REGISTER 16 BTD LOW_WORD_INPUT 0 FLOAT_REGISTER 0"

Thanks in advance
David
 
Last edited:

Similar Topics

Hi there, I'm trying to tune the "completion pressure" for every material on the baler to something possible with three dying cartridges in...
Replies
0
Views
1,074
I'm using RsLogix Micro Starter Lite for some basic PLC programming. I have an incoming RS-422 message that is composed of hex bytes. Some of...
Replies
8
Views
5,435
Hi Everyone, I am not proficient in RSLogix 500 so I have a question regarding the evaluation of N7:0 data as an input. So as I understand in...
Replies
1
Views
84
Hi folks, in the alarm manager of Rslogix 5000, the tag-based alarm has been created. But when I tried to change the condition, it was found the...
Replies
2
Views
152
I have a little bit of experience with Allen-Bradley. I have a Micrologix 1500 (RSLogix 500) and a PanelView Plus 7 (FactoryTalk View Studio ME)...
Replies
3
Views
162
Back
Top Bottom