bit shift PLC instruction help please

There are four inputs and three outputs for the SHIFTL_WORD instruction.

The top input is boolean logic flow and is the enabling logic. When true, the shift is performed. Unless you want the shift to be performed every scan, make sure this input is a one-shot.

The input labeled "IN" is the address of the starting point of the range of bits to be shifted. If you leave the value inside the function at its default setting of 1, the range of the shift is 16 bits starting at the address specified at "IN". A value of 2 inside the box sets a range of 32 bits, etc.

The input labeled "N" wants numeric data. It is the number of places to shift each time the enabling logic is true. Most of the time this value is 1.

The input B1 is boolean. When true, you shift a "1" into the bit array. When false, you shift in a "0".

The "Q" output is the starting address of the shifted bits. In the OP's case it should be the same address as the "IN" input.

The B2 output is optional and boolean. It is true if the bit shifted out is true. It won't be of any use in the OP's case since he's only interested in the value two positions downstream.

If the OP uses a SHIFTL_WORD instruction with a length of 1 and address %M0017, then %M0019 will represent the presense or absense of a part at the stamping nest. Note that the starting address needs to be on a byte boundary, %M0001, %M0009, %M0017, %M0025 etc.

Thanks for the explanation. Cleared up a lot of confusion for me.
 

Similar Topics

Hi All. I have a very specific question about tracking using an encoder and bitshift register. We would like to use a Compact or Control Logix PLC...
Replies
40
Views
1,695
Hello. I've been using the answers in this forum for a while now, so thank you. Usually I can find the answer I'm looking for with a basic...
Replies
8
Views
741
Good morning (EST), I am trying to implement the code below in on an S7-1200. It's barely half a dozen instructions, but I am stuck; I have not...
Replies
26
Views
5,647
I have a program I need to work out for a client and I'm having trouble figuring out the correct logic to do it. Let me see if I can explain it...
Replies
27
Views
6,453
I am having trouble figuring out how to track a product using a BSL instruction. The way that I have it set up is: I have an infeed eye that...
Replies
10
Views
2,736
Back
Top Bottom