Description
The instruction "Create bit pattern for seven-segment display" is used to convert each of the four hexadecimal digits of the specified source word (IN) into an equivalent bit pattern for a seven-segment display. The result of the instruction is output in the double word on the OUT parameter.
The following relation exists between the hexadecimal digits and the assignment of the 7 segments (a, b, c, d, e, f, g):
Parameters
The following table shows the parameters of the "Create bit pattern for seven-segment display" instruction:
|
Parameter |
Declaration |
Data type |
Memory area |
Description |
|---|---|---|---|---|
|
EN |
Input |
BOOL |
I, Q, M, D, L, T, C or constant |
Enable input |
|
ENO |
Output |
BOOL |
I, Q, M, D, L |
Enable output |
|
IN |
Input |
WORD |
I, Q, M, D, L, P or constant |
Source word with four hexadecimal digits |
|
OUT |
Output |
DWORD |
I, Q, M, D, L, P |
Bit pattern for the seven-segment display |
Example
The following example shows how the instruction works:
The following table shows how the instruction functions using specific values:
|
Parameters |
Operand |
Value |
|
|---|---|---|---|
|
Hexadecimal |
Binary |
||
|
IN |
Tag_Input |
W#16#1234 |
0001 0010 0011 0100 |
|
OUT |
Tag_Output |
DW#16065B4F66 |
00000110 01011011 01001111 01100110 Display: 1234 |