Logic with Contacts
AND LOGIC — Series Contacts
Figure 1 - Series Contacts
The figure above executes a logical AND between the last two elements loaded into the STACK, lowers the STACK one level, and pushes the result to the top of the STACK. This means the following Boolean operation is performed: top of STACK = BIT1.BIT2.
In IL (Instruction List) language:
LD BIT1 (* carrega o valor de BIT1 para o STACK = | BIT1 | *)
LD BIT2 (* carrega o valor de BIT2 para o STACK = | BIT2 | BIT1 | *)
AND (* executa AND entre BIT1 e BIT2 -> STACK = | BIT1.BIT2 | *)
Truth Table (AND)
| BIT1 | BIT2 | STACK |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR LOGIC — Parallel Contacts
Figure 2 - Parallel Contacts
The figure above executes an OR logic between the last two elements loaded into the STACK, reduces the STACK one level, and places the result at the top of the STACK. In other words: top of STACK = BIT1 OR BIT2.
In IL (Instruction List) language:
LD BIT1 (* carrega o valor de BIT1 para o STACK = | BIT1 | *)
LD BIT2 (* carrega o valor de BIT2 para o STACK = | BIT2 | BIT1 | *)
OR (* executa OR entre BIT1 e BIT2 -> STACK = | BIT1+BIT2 | *)
Truth Table (OR)
| BIT1 | BIT2 | STACK |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |