Merge Two Integers

B Fix

Member
Join Date
Nov 2008
Location
ND
Posts
17
I will be using a PLC 5/80E with a Rice Lake 920i weigh scale on remote IO. Looking at the 920i Remote IO card manual, the device sends me back the weight split up as a 16 bit integer and then the first 4 bits of the next integer, making it 20 bits long. How do I combine the two integers, for example into a floating point register, so that I can work with the correct weight?

Hopefully this all makes sense. Help is much appreciated
 
Do you know what the format will be? If the first integer is whole number and second integer the decimal all you need to do is add them and store them in a floating point. If you are getting a whole number that is 20 bits move the 16bit integer to a floating point register and multiply by 1000 then add in the 2nd integer. It all depends on the format of the number you expect to receive.
 
B Fix said:
I will be using a PLC 5/80E with a Rice Lake 920i weigh scale on remote IO. Looking at the 920i Remote IO card manual, the device sends me back the weight split up as a 16 bit integer and then the first 4 bits of the next integer, making it 20 bits long. How do I combine the two integers, for example into a floating point register, so that I can work with the correct weight?

Hopefully this all makes sense. Help is much appreciated

I happen to have code to do this in RSLogix5000 for the Rice Lake scales over RIO. I pretty much copied/pasted it from Rice Lake's website. They have code snippet to do what you want on their site.

EDIT: Well it looks like you now have to buy the RIO manual for $35. What a crock. Call your distributor and they should be able to get you the manual which has the code examples in it, or if you have access to RSLogix5000, I can send you mine as an example.
 
Last edited:
Thanks for the help.

I did find a way to merge the two into one 20 bit integer. I just used the 2^xx power for each bit and added them together into one float.

robertmee, do you happen to have a link to where you found the sample code? I looked all over there website and was unable to find anything.
 
Use a two BTD's into the same floating point word. 1st BTD moves the 1st integer from bit 0 to bit 0 of the floating point register. The second BTD moves the data from the second integer starting at bit 0 to the destination of of bit 16 of the floating point integer. It in the RA knowledgbase somewhere.
 
B Fix said:
Thanks for the help.

I did find a way to merge the two into one 20 bit integer. I just used the 2^xx power for each bit and added them together into one float.

robertmee, do you happen to have a link to where you found the sample code? I looked all over there website and was unable to find anything.

See my edit in the previous post....I couldn't find it any longer either.
 

Similar Topics

Hello, besides a post on this site from 2016, I haven't seen any questions or answers regarding this. Is if it is possible to strip the RSLinx...
Replies
2
Views
1,561
Is there a simple way to merge the description off line for RS 5000 Like RS 500 I am new to RS5000 and have several applications running that have...
Replies
1
Views
1,071
dear friend, i use rslogix 5000.I have a program consisting of several ladder diagrams.is there a way to merge them in only one logic diagram to...
Replies
4
Views
1,640
I have 2 different .RSX (RSLinx configuration) files. I would like to make them one file. Is there any way to merge these files?
Replies
1
Views
1,823
How do you merge off line a rs 5000 program with one that has descriptions on the tags. I have done rs 500 but never 5000
Replies
2
Views
1,454
Back
Top Bottom