Spliting 32-bits(DINT) into 2 INT

AmazingTrans

Member
Join Date
Nov 2005
Location
Illinois
Posts
38
Hi gurus,

I have a mathematical problem. I'm programming in RSLogix500 a Micrologix 1500. it does not have many functions, such as Bit distribute and such.

I'm trying to split a Double Int value into two Int value. then later when I send it through CIP message to my compactlogix, I want to concatenate them back to a double Int word. I'm doing this because when I'm reading a counter off the micrologix, it was fine, but when I send the DINT thru the communication into my ControlLogix, once in a while it has a spike up value.

I tried doing a no greater than 65535 then AND 65535 on the counter, then just move the DINT into INT, After that, The last 16bits, I thought of Bit shift right, then And again. Not sure what I'm doing> So please enlighten me. Thanks
 
Read up on the copy command (COP) in both processors and the synchronous copy command (CPS) in the CompactLogix. That should do the trick for you.


Keith
 
Counter jumping...

I'm doing an ethernet message read of a counter value off the micrologix to compactlogix. When the counter is not running, I put up trends on the micrologix and compactlogix counter tag. I found out that the counter tag value for that compactlogix somehow spike up to 2millions, but the micrologix counter tag did not. Any idea why did it do that, and how to solve this problem?
 
What's probably going on is that you're running a COP instruction on the CompactLogix side that executes at the exact same instant that one of the 16-words from the MSG instruction is being updated in the background, which gives you a corrupted 32-bit value.

This is one of the reasons for the Copy Synchronous instruction in the ControlLogix; it locks the source data registers while it's reading from them.

What is the exact source data; a Counter ACC value, or a Long Integer, or something else ?
 

Similar Topics

Hi I am being given several fault words (as a DINT) from a Drive that I am receiving into a Compactlogix L33ER controller. I have a small...
Replies
12
Views
1,140
Dear Fellows; I am working on a very old machine which is designed in GE 90-30 PLC system. I have some difficulties like 1. How a force to...
Replies
3
Views
347
Hi All, I am trying to write some simulation logic for an existing project im working on. Does anyone know if this is possible to write to...
Replies
6
Views
1,278
Hi, I have this code: LAR1 P##structy L 0 T LW [AR1,P#0.0] which resets all the bits in this struct called structy...
Replies
1
Views
641
I am passing DINTs between a Micro800 and CompactLogix - each bit in the DINT has its own unique meaning. On the Studio5000 side I can just write...
Replies
3
Views
1,101
Back
Top Bottom