Chapter 4. Ladder Diagram (LD) ProgrammingGFK-2950C February 2018 814.2.9 Rotate BitsMnemonics:ROL_DWORDROL_WORDROR_DWORDROR_WORDWhen receiving power flow, the Rotate Bits Right (ROR_DWORD and ROR_WORD) and Rotate BitsLeft (ROL_DWORD and ROL_WORD) functions rotate all the bits in a string of WORDs or DWORDs Npositions respectively to the right or to the left. When rotation occurs, the specified number of bits isrotated out of the input string respectively to the right or to the left and back into the string on theother side.The Rotate Bits function passes power flow to the right, unless the number of bits to rotate is lessthan 0, or is greater than the total length of the string. The result is placed in output string Q. If youwant the input string to be rotated, the output parameter Q must use the same memory location asthe input parameter IN. The entire rotated string is written on each scan that power is received.A string length of 1 to 256 words or double words can be specified.Operands for Rotate BitsParameter Description Allowed Operands OptionalLength (??) The number of WORDs or DWORDs in thestring to be rotated. 1 Length 256.Constant NoIN The string to rotate All. Constants are legal when Length is 1 NoN The number of positions to rotate. 0 ≤ N ≤Length.All except variables in %S - %SC memories NoQ The resulting rotated string All except constants and variables in %SmemoryNoExampleWhenever input V_I0001 is set, the input bit string in location%R0001 is rotated left 3 bits and the result is placed in%R00002. The actual input bit string %R0001 is left unchanged.If the same reference had been used for IN and Q, a rotationwould have occurred in place.MSB%R0001MSB%R0002 (after %I00001 is set)