Bit shifts

Join Date
Jun 2019
Location
missouri
Posts
1
Guys,
Good morning I'm drawing a blank here. I have a Studio5000 and i'm writing a program one of the Turck I/O blocks I am reading from is a IOLink device and the input has multiple functions in the word the 1st 2 bits are the outputs and the last 14 bits are the analog value of the device. I need to read the last 14 bits. In logic how do I do this?
 
If I understand correctly, you should be able to use a BSL instruction to shift the data by 2 bits. This will leave you with the 14 bits at the least significant bit.
 
Are the first 2 bits LSB or MSB?

If they are least significant, then Bit Shift Right. If most significant, I would copy to an INT (value), then use OTUs to set value.14 and value.15 to false
 
I used a BTD command for this type of situation last year.

+1

Source: NotShifted
Source bit: 2
Dest: shifted
Dest bit: 0

If the data looks non-sensical after this, maybe an Endian-ness issue, resolve with a SWPB mode Reverse.

And welcome to the forum!
 

Similar Topics

W
In SLC 500 language, how can I accomplish the following: N7:0 xxxx xxxx 0101 1101 (only 8 bits will be needed for both) N7:1 xxxx xxxx 1010...
Replies
1
Views
2,631
See the screenshot of EIP tag list. We are trying to read in a digital input that is hard-wired. It is shown here as I31.1. I believe we cannot...
Replies
7
Views
270
A couple days ago I accidentally toggled an alwasyoff bit. The issue is it was set up as a single OTU on a rung, nothing else, and used as XICs...
Replies
3
Views
219
Hi I have an old panel builder 32 that I’m replacing for a factory talk me hmi . In the plc for the old panel builder there is a coms bit for the...
Replies
0
Views
68
Hello, Haven't been on in a while. I need to generate a bit level pdf of the I/O for RSLogix 500. I can generate a report but it just shows the...
Replies
1
Views
143
Back
Top Bottom