Technical Reference for ZyXEL omni.net series
bits in the
For example, if you want to set S38 bit 3 to 1 for a specific application, you may either use the
1.Read the value from S38 using ATS38?
NOTE: The values used in the example below differ from the actual values in the
2.Convert it to binary, using the following weight table:
| Bit |
|
| Binary value |
|
| Decimal value |
|
| Hexadecimal value |
|
0 |
| 00000001 |
| 1 |
| $01 |
| ||||
1 |
| 00000010 |
| 2 |
| $02 |
| ||||
2 |
| 00000100 |
| 4 |
| $04 |
| ||||
3 |
| 00001000 |
| 8 |
| $08 |
| ||||
4 |
| 00010000 |
| 16 |
| $10 |
| ||||
5 |
| 00100000 |
| 32 |
| $20 |
| ||||
6 |
| 01000000 |
| 64 |
| $40 |
| ||||
7 |
| 10000000 |
| 128 |
| $80 |
|
3.To set bit 3 to 1 (binary), do a logic OR operation with the value.
| Operation |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
| Binary |
|
| Dec. |
|
| Hex |
|
| Binary |
|
| Dec. |
|
| Hex. |
|
|
|
| 10001000 |
| 136 |
| $88 |
| 01000000 |
| 64 |
| $40 |
| ||||||
OR |
| 00001000 |
| 8 |
| $08 |
| 00001000 |
| 8 |
| $08 |
| |||||||
|
|
| 10001000 |
| 136 |
| $88 |
| 01001000 |
| 72 |
| $48 |
|