GE GFK-0804B Universal Remote User Manual


 
4
4-42 Micro PLC Programmer’s Guide – April 1994
GFK-0804B
Shift Register Right
Each scan that power flow is received, the Shift Register Right function shifts all the bits
in a register to the right (toward the least significant bits). The number of positions to be
shifted is provided in the function’s second register (R2 in the example above).
The data is copied to the register specified (R3 in the example above). The original data is
not altered. In the copied data, the specified number of bits is “shifted out” on the right,
and a corresponding number of zeros is moved in on the left.
Example:
For this example, if the second register (R2) contained the value 3, the bits would be
shifted right by 3 positions:
0 0 0 0 0 0 0 0 1 1 1 1 1 0 1 0
R1
(250)
SHR
0 0 0 0 0 0 0 0 0 0 1 1 1 1 10
R3
(31)
46149
Entering the Number of Positions to Shift
The best way to enter the number of positions for the shift into the second register is
with a Move command in the application program. Alternatively, you could use the
programmer to manually place the number into a retentive register (R385 – R500).
Programming Software Instructions
1. Select Logic (F7)
2. Select SH–REG RIGHT (F5) from the Logic function keys.
3. Enter the register location of the data to be shifted right. Press the Enter key.
4. Enter the register location for the number of bits to shift. Press the Enter key.
5. Enter a register for shifted data to be placed in. Press the Enter key.
Example and HHP Instructions
Ladder Diagram Hand-held Programmer
START
LOGIC
OUT
F1
More MENU
F2
F1
I1
R1
R2
R3
[ R1 H R2! R3]
R
S
I1
"
4615
0