6F3B0250
7. Instructions
FUN 064
TEST
Bit test
Expression
Input
Function
When the input is ON, this instruction finds logical AND of A and B. Then if the result is not 0, sets the output to ON.
Execution condition
Input |
| Operation | Output |
OFF | No execution | OFF | |
ON | Execution | When the result is not 0 | ON |
|
| When the result is 0 | OFF |
Operand
| Name |
|
| Device |
|
|
|
|
|
| Register |
|
|
|
| Constant | Index | ||
|
| X | Y | R | S | T. | C. | XW | YW | RW | SW | T | C | D | I | J | K |
|
|
A | Source |
|
|
|
|
|
| Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö |
B | Test data |
|
|
|
|
|
| Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö |
Example
Logical AND operation is executed for the data of RW07 and the constant data H0FFF, and if the result is not 0, R00A is turned ON. (R00A is turned ON when any device from R070 to R07B is ON.)
If the data of RW07 is H4008, R00A is turned ON.
RW07
F E D C B A 9 8 7 6 5 4 3 2 1 0
0 | 1 |
| 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| 4 |
|
|
| 0 |
|
|
| 0 |
|
|
| 8 |
|
| ||
|
|
|
|
|
|
|
|
| AND |
|
|
|
|
|
|
|
Constant | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 |
| 1 | 1 |
|
| 0 |
|
|
| F |
|
|
| F |
|
|
| F |
|
| ||||
|
|
|
|
|
|
|
|
|
|
|
|
| ||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Result | 0 | 0 |
| 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 0 |
Result is not 0
R00A comes ON
Basic Hardware and Function 181
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net