For example, to assemble the control byte that will turn on relays 0. 1. 3. 5 and 7 we can see from the chart below we need to write decimal 171 (hex AB):
RELAY | HEX | ON = 1 | WEIGHT | DECIMAL | ON=1 | WEIGHT |
OP7 | 80 | 1 | 80 | 128 | 1 | 128 |
OP6 | 40 | 0 | 0 | 64 | 0 | 0 |
OP5 | 20 | 1 | 20 | 32 | 1 | 32 |
OP4 | 10 | 0 | 0 | 16 | 0 | 0 |
OP3 | 8 | 1 | 8 | 8 | 1 | 8 |
OP2 | 4 | 0 | 0 | 4 | 0 | 0 |
OP1 | 2 | 1 | 2 | 2 | 1 | 2 |
OP0 | 1 | 1 | 1 | 1 | 1 | 1 |
|
|
| AB |
|
| 171 |
4.2 PROGRAMMING NOTES
WRITE = CONTROL: Write a byte to the register to control the relays. A one in the relay bit position turns the relay on.
READ = STATUS: Read the status of the relay control register. A one in the relay bit position indicates the relay is on.
ON & OFF for FORM C RELAYS:
On means that FORM C relay common is in contact with the Normally Open contact. Off means that FORM C relay common is in contact with the normally closed contact.
4.3 DETAILED RELAY CONTROL I/O MAP
The following section provides a detailed description of the register map and relay control registers.
Base Address +0 (applicable to all
RELAY | OP7 | OP6 | OP5 | OP4 | OP3 | OP2 | OP1 | OP0 |
BIT No. | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
HEX Value | 80 | 40 | 20 | 10 | 8 | 4 | 2 | 1 |
DECIMAL | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Base Address +1 (RELAY16, 24 and 32 only) |
|
|
|
| ||||
RELAY | OP15 | OP14 | OP13 | OP12 | OP11 | OP10 | OP9 | OP8 |
BIT No. | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
HEX Value | 80 | 40 | 20 | 10 | 8 | 4 | 2 | 1 |
DECIMAL | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Base Address +2 (RELAY24 and 32 only) |
|
|
|
|
| |||
RELAY | OP23 | OP22 | OP21 | OP20 | OP19 | OP18 | OP17 | OP16 |
BIT No. | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
HEX Value | 80 | 40 | 20 | 10 | 8 | 4 | 2 | 1 |
DECIMAL | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Base Address +1 | (RELAY32 only) |
|
|
|
|
| ||
RELAY | OP31 | OP30 | OP29 | OP28 | OP27 | OP26 | OP25 | OP24 |
BIT No. | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
HEX Value | 80 | 40 | 20 | 10 | 8 | 4 | 2 | 1 |
DECIMAL | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
7 | 8 |