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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7. Instructions<br />

FUN 040 U/ Unsigned division<br />

Expression<br />

Input −[ A U/ B → C ]− Output<br />

Function<br />

When the input is ON, the unsigned data of A is divided by the unsigned data of B, and the<br />

quotient is stored in C and the remainder in C+1.<br />

The data range of A and B is 0 to 65535 (unsigned 16-bit data)<br />

Execution condition<br />

Input Operation Output ERF<br />

OFF No execution OFF −<br />

ON Normal execution (B ≠ 0) ON −<br />

No execution (B = 0) OFF Set<br />

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

6F3B0253<br />

Operand<br />

Name Device Register Constant Index<br />

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

A Dividend √ √ √ √ √ √ √ √ √ √ √ √<br />

B Divisor √ √ √ √ √ √ √ √ √ √ √ √<br />

C Quotient √ √ √ √ √ √ √ √ √ √<br />

Example<br />

When R010 is ON, the data of D0030 is divided by the constant data 300, and the quotient is<br />

stored in D0050 and the remainder is stored in D0051.<br />

If the data of D0030 is 54321, the quotient 181 is stored in D0050 and the remainder 21 is<br />

stored in D0051.<br />

D0030 54321<br />

÷ RW27 181 (quotient)<br />

Constant 300 RW28 21 (remainder)<br />

Note<br />

• If divisor (operand B) is 0, ERF (instruction error flag = S051) is set to ON.<br />

The ERF (S051) can be reset to OFF by user program, e.g. −[ RST S051 ]−.<br />

• If the index register K is used as operand C, the remainder is ignored.<br />

• This instruction handles the register data as unsigned integer.<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!