321
4
4 Instructions 4.12.3 7-segment LED Display
First data set
Y0
Y2
COM1
Y1 Y3
Second data set
Y4
Y6
COM2
Y5 Y7
Y10
Y12
COM3
Y11Y13
1
2
4
8
1
2
4
8
Thousands
place
Hundreds
place
Tens
place
Ones
place
Thousands
place
Thousands
place
Hundreds
place
Hundreds
place
Tens
place
Tens
place
Ones
place
Ones
place
12 4
8
12 4
8
Bit gating
VDDVDD
BCD
data
PLC (MT type)
In the preceding hardware wiring diagram, the rst 7-segment LED display shows the content of D0, and
the second one shows the content of D1. A program running error will occur if the readings of D0 or D1
exceed 9999.
The 7-segment LED displays shown in the wiring diagram feature data display latch, 7-segment decoding
and driving, and a negative logic model. (When the input port is at low level, the input data is 1 or gated.)
During display processing, ports Y4 to Y7 of the PLC perform cyclic scan automatically. Only one port
is ON at a time and functions as a bit gating signal. The data on ports Y0 to Y3 is the BCD data sent to
corresponding bits. When the bit gating signal switches from ON to OFF, the data is latched to 7-segment
LED displays, which display digits after internal decoding and driving. The PLC system performs the same
processing on Y4 to Y7 in sequence until all four bits are processed. Y10 to Y13 are the data output ports
of the second 4-digit 7-segment LED display and share the bit gating wire with Y4 to Y7. The processing
method is the same. Display is processed simultaneously for both 7-segment LED displays. In the example,
if D0 = K2468 and D1 = K9753, the rst 7-segment LED display shows "2 4 6 8", and the second one
shows "9 7 5 3".
It takes 12 scan cycles to complete a display refresh operation. The M8029 ag is set to ON after
processing is completed.
Set n as follows based on the positive and negative logic of the PLC and 7-segment codes:
n = 0–3 when there is one 4-digit data set. n = 4–7 when there are two 4-digit data sets.
Number of
Displayed Data
Sets
One set Two sets
Y Data Output
Polarity
PNP NPN PNP NPN
Gating and Data
Polarity
Same Inverse Same Inverse Same Inverse Same Inverse
Value of n 0 1 2 3 4 5 6 7
The value n determines whether the transistor output polarity of the PLC and the input polarity of 7-segment
LED displays are the same or inverse.
The Y output polarity of the H1U and H2U series PLCs of the transistor output type is NPN. This instruction
can be used twice at most in a program.
Usage:
Because relays are not suitable for high-frequency scan output, this instruction is only applicable to PLCs of
the transistor output type.