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 122 BC Bit count<br />

Expression<br />

Input −[ A BC B ]− Output<br />

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

6F3B0253<br />

Function<br />

When the input is ON, this instruction counts the number of ON (1) bits of A, and stores the result<br />

in B.<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 Source √ √ √ √ √ √ √ √ √ √ √<br />

B Count data √ √ √ √ √ √<br />

Example<br />

When R020 is ON, the number of ON (1) bits of the register RW032 is counted, and the result<br />

is stored in D0102.<br />

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

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

RW032 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0<br />

Counts the number of ON (1) bits = 7<br />

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

D0102 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1<br />

The result data (7) is stored in binary<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!