Character: [
Decimal: 91
Hexadecimal: 0x5B
Command Value: Mask of Digital Output Bits to Set
This command uses the Command Value to determine which outputs to set. The value is treated as a bit mask. The bits set in the Command Value will set the corresponding outputs.
With a Communication DI/O, bits 0 (hexadecimal value 0x0001) to 7 (hexadecimal value 0x0080) are used for the corresponding outputs on that module. However, some of these outputs are reserved, so refer to the Communication Digital I/O topic for more details.
Without this module, the CPU outputs 0 and 1 are represented by hexadecimal values 0x0001 and 0x0002 respectively.
When a Sensor Digital I/O is used, bits 8 (hexadecimal value 0x0100) to 15 (hexadecimal value 0x8000) represent outputs 0 to 7 on that module.
Use the following chart to help find the correct hexadecimal Command Value for turning on the desired bits. The Command Value is comprised of four hexadecimal digits. The first two digits are used for setting outputs on the Sensor Digital I/O, and the last two digits are used for setting outputs on the Communication Digital I/O. Each row of the chart begins with a hexadecimal digit. To the right of each digit, the corresponding binary pattern is repeated four times, once for each digit. For this command, binary 1’s represent outputs to be turned on, while binary 0’s represent unchanged outputs. Notice, that you will be treating each digit of the command value separately, so that you will most likely use more than one hexadecimal digit row. Remember that you must enter a leading ’r;0’ to enter a hexadecimal value. Following are some examples:
To turn on bit 0 of the Communication Digital I/O, the command value should be 0x0001. The first three digits are zero to indicate that all Sensor Digital I/O outputs and outputs 4-7 of the Communication Digital I/O are untouched. The ’r;1’ in the fourth digit indicates that output 0 is turned on, but outputs 1-3 are untouched. Recall that the leading 0 in the command value is only used to indicate that the number is hexadecimal.
To turn on bits 2, 3, 6 and 7 of the Communication Digital I/O, the command value should be 0x00CC.
To turn on all eight Sensor Digital I/O outputs, the command value should be 0xFF00.
To turn on bit 2 of the Communication Digital I/O, the command value should be 0x0004.
Command Value |
First |
Second |
|
Third |
|
Fourth |
|||||||||||||
Hex F = |
1 |
1 |
1 |
1 |
|
1 |
1 |
1 |
1 |
|
1 |
1 |
1 |
1 |
|
1 |
1 |
1 |
1 |
Hex E = |
1 |
1 |
1 |
0 |
|
1 |
1 |
1 |
0 |
|
1 |
1 |
1 |
0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|
0 |
0 |
|
0 |
0 |
0 |
0 |
|
0 |
0 |
0 |
0 |
Output |
Sensor DI/O |
|
Comm. DI/O |
||||||||||||||||
Numbers |
7 |
6 |
5 |
4 |
|
3 |
2 |
1 |
0 |
|
7 |
6 |
5 |
4 |
|
3 |
2 |
1 |
0 |
Note: The above discussion on determining the correct hexadecimal number to turn on one or more outputs applies also to the Reset Outputs command. The only difference is that the outputs represented by a binary ’r;1’ are turned off instead of on.
See also: Reset Outputs
Copyright (c) 1997-2015 by Delta Computer Systems, Inc.