03.01.2013 Views

Toshiba PROSEC T1-16S PLC User's Manual - CTi Automation

Toshiba PROSEC T1-16S PLC User's Manual - CTi Automation

Toshiba PROSEC T1-16S PLC User's Manual - CTi Automation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7. Instructions<br />

FUN 070 SHR n bit shift right<br />

Expression<br />

Input −[ A SHR n → B ]− Output<br />

166 <strong>T1</strong>-<strong>16S</strong> User’s <strong>Manual</strong><br />

6F3B0253<br />

Function<br />

When the input is ON, the data of register A is shifted n bits to the right (LSB direction) including<br />

the carry flag (CF = S050), and stored in B. 0 is stored in upper n bits. After the operation, if the<br />

right most bit (LSB) is ON, the output is turned ON.<br />

Execution condition<br />

Input Operation Output CF<br />

OFF No execution OFF −<br />

ON Execution When LSB = 1 ON Set or reset<br />

When LSB = 0 OFF Set or reset<br />

Operand<br />

Name Device Register Constant Index<br />

X Y R S T. C. XWYWRWSW T C D I J K<br />

A Source √ √ √ √ √ √ √ √ √ √ √ √<br />

n Shift bits 1 - 16<br />

B Destination √ √ √ √ √ √ √ √ √ √<br />

Example<br />

When X007 is changed from OFF to ON, the data of RW18 is shifted 5 bits to the right and the<br />

result is stored in RW20.<br />

The figure below shows an operation example.<br />

(MSB) (LSB)<br />

F E D C B A 9 8 7 6 5 4 3 2 1 0<br />

RW18 0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0<br />

CF<br />

RW20 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1<br />

(Result)<br />

0 R001 is turned OFF<br />

<strong>CTi</strong> <strong>Automation</strong> - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!