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 162 MAX Maximum value<br />

Expression<br />

Input −[ A MAX (n) B ]− Output<br />

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

6F3B0253<br />

Function<br />

When the input is ON, this instruction searches for the maximum value from the table of size n<br />

words starting with A, and stores the maximum value in B and the pointer indicating the position of<br />

the maximum value in B+1. The allowable range of the table size n is 1 to 64.<br />

Execution condition<br />

Input Operation Output<br />

OFF No execution OFF<br />

ON Execution ON<br />

Operand<br />

Name Device Register Constant Index<br />

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

A Start of table √ √ √ √ √ √ √<br />

n Table size 1 - 64<br />

B Result √ √ √ √ √ √ √ √ √<br />

Example<br />

When R010 is ON, the maximum value is found from the register table D0200 to D0209 (10<br />

words), and the maximum value is stored in D0500 and the pointer is stored in D0501.<br />

Pointer<br />

D0200 100 0<br />

D0201 10000 1<br />

D0202 -1000 2<br />

D0203 10 3<br />

D0204 0 4<br />

D0205 200 5<br />

D0206 -300 6<br />

D0207 20000 7 D0500 20000 (Maximum value)<br />

D0208 -30 8 D0501 7 (Pointer)<br />

D0209 20 9<br />

Note<br />

• This instruction deals with the data as signed integer (-32768 to 32767).<br />

• If there are two or more maximum value in the table, the lowest pointer is stored.<br />

• If Index register K is used as operand B, the pointer data is discarded.<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!