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.

FUN 041 DIV Unsigned double/single division<br />

Expression<br />

Input −[ A+1⋅A DIV B → C ]− Output<br />

6F3B0253<br />

7. Instructions<br />

Function<br />

When the input is ON, the double-word data of A+1⋅A is divided by the data of B, and the quotient<br />

is stored in C and the remainder in C+1. The data range of A+1⋅A is 0 to 4294967295, and the data<br />

range of B and C is 0 to 65535.<br />

If the quotient is greater than 65535 (overflow), the limit value 65535 is stored in C, 0 is stored in<br />

C+1, and the instruction error flag (ERF = S051) is set to ON.<br />

Execution condition<br />

Input Operation Output ERF<br />

OFF No execution OFF −<br />

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

Overflow (B ≠ 0) ON Set<br />

No execution (B = 0) OFF Set<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 double-word data of D0201⋅D0200 is divided by the constant data<br />

4000, and the quotient is stored in D1000 and the remainder is stored in D1001.<br />

If the data of D0201⋅D0200 is 332257, the quotient 83 is stored in D1000 and the remainder<br />

257 is stored in D1001.<br />

D0201⋅D0200 332257<br />

÷ D1000 83 (quotient)<br />

Constant 4000 D1001 257 (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 />

• This instruction handles the register data as unsigned integer.<br />

Basic Hardware and Function 153<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!