Move bits between data types and locations

J2009

Member
Join Date
Dec 2016
Location
South Carolina
Posts
23
I am reading 32 bits from a DCS system into a DINT tag. I need to move this data into 4 INT tags. 1st 8 bits to one tag, next 8 bits to another tag and so on.

When I try to COP DINT BREAK_DATA.0 to INT BREAK_DATA.1 I get an error because data types do not match.

Is there any way to do this?
 
INT = 16 bits; 4 INT = 4 x 16 = 64 bits

You probably need to move a DINT (32 bits) into two INTs (2 x 16).

If this is the case then you need to use two BTD (Bit Field Distribute) instructions where the Source will be the original DINT.

The first BTD will use the Source Bit '0', the Destination will be the first INT, the Destination Bit will be '0' and the Length will be '16'.

The second BTD will use the Source Bit '17', the Destination will be the second INT, the Destination Bit will be '0' and the Length will be '16'.
 

Similar Topics

Hi I'm trying to move bits in to a word. I'm wanting to move %10.0 - %10.13 (Onboard Inputs) in to %MW1 I've tried moving one bit in to another...
Replies
1
Views
1,436
Hi I'm trying to move bits in to a word. I'm wanting to move %10.0 - %10.13 (Onboard Inputs) in to %MW1 I've tried moving one bit in to...
Replies
4
Views
3,381
Hey. I need some input on how to solve this task i am struggeling with. In the picture I attatched to this post, i tried to display what my task...
Replies
40
Views
16,353
I am using Unity Pro XL 4.1 Is there an easy way to move a Boolean value to every bit of an Integer? There is a function for moving a boolean to...
Replies
1
Views
5,805
Using Siemens Step 7, I and wanting to move 8 sequential bits into a Byte using the label instead if the direct address so that adding/removing...
Replies
38
Views
17,769
Back
Top Bottom