1 Introduction Programming Logic Controller (PLC) is an industrial computer that integrates data acquisition, processing, and display. As a data terminal, data display is essential. Although PLC has many indicator lights that can be used to observe the operating status of the CPU unit, input/output unit, and network communication unit, they cannot display the internal data of the PLC. Computers can display the internal data of the PLC through communication with the PLC and touch screens, but these are expensive and wasteful for some small systems that do not require frequent modifications. This paper uses DIP switches and digital tubes to display the internal data of the PLC. The operation is simple and the cost is low, which is of reference value for experimental teaching and engineering personnel. (1) Application industries: machining, process control, etc. (2) Products used: CJ1M (CPU22), CS1W-ID211, CS1W-OD261 (3) Main process points and main problems to be solved: dynamic display of internal data (4) Application scheme: The dynamic display of internal data is achieved by using a high-frequency transistor output unit combined with the high-speed timer instruction TIMH. 2. Dynamic Data Display 2.1 Hardware System Design LED digital tubes have 7 segments, which can be used to display 10 numbers from 0 to 9. The internal channel data of the CJ1M series PLC is generally four digits. If each output point is used to control one display light, then one digital tube would require 7 output points, which obviously occupies a lot of output points and is uneconomical. Here, a digital tube with a built-in decoding circuit, such as CD4511, is selected, which can automatically decode 8421 code into 7-segment code. 8421 code or BCD code can be displayed as one data digit using 4 interfaces plus strobe signals. The four 8421 input lines are combined and connected to the lowest four bits of a certain output channel. The input signal of each strobe signal is connected to the remaining four bits in the channel, so that one output channel can display four digits (one word) of internal data of the PLC. The specific wiring diagram is shown in Figure 1. [align=center] Figure 1 PLC Hardware Wiring Diagram[/align] Note that the PLC output module here should be a transistor or thyristor output unit, and not a relay output unit. Because the relay output unit is a contact switch, the response is slow and the speed is low, it is not suitable for high frequency switching, nor is it suitable for dynamic data display[1]. Therefore, in Figure 1, the OMRON CJ1W-OD261 (64-point) transistor is used as the output unit, and its IO address on this PLC rack is allocated to 6.00~9.15. Here, channel 0006 is used as the internal data display channel. 6.00~6.03 are the data input terminals A, B, C, and D of CD4511, where A is the least significant bit and D is the most significant bit. When it is high level, the data is latched. The terminals of the four data bits are controlled by PLC 6.04~6.07 respectively. The four digital tubes occupy a total of 8 output points. 2.2 Generation of selection signal Since the lines of the four digital tubes are all controlled by one I/O port, at any given moment, the four LEDs will display the same character. In order to display different characters for each digit, it is necessary to use the scanning method to turn on each LED in turn, that is, only one digit displays the character at any given moment. To make each character display the character to be displayed in time division, according to the visual characteristics of the human eye, when the frequency of the signal applied to the LED is greater than 50Hz, the human eye cannot perceive the change, so the interval between each display cannot exceed 20ms. That is to say, all LEDs should be lit in time division within 20ms. The more LEDs there are, the shorter the time division will be, and the brightness will be insufficient. If the lighting time is increased, the scanning frequency will decrease, and there will be a flickering sensation, which will easily cause eye strain. Therefore, dynamic scanning method is often used [2]. This scanning method is only suitable for situations where there are no more than 10 LEDs. In this example, there are only 4 LED digital tubes, so this method can be selected. The CJ1M series PLC has a rich set of timing instructions. Its timer types are 1ms, 10ms and 100ms. Here, the TIMH instruction is selected [3]. The timer setting value is #1, so the period of the strobe signal is 10ms. 2.3 Synchronization processing The PLC adopts a cyclic scanning working mode. The execution of the instruction is from top to bottom and from left to right. The result of the previous cycle will affect the result of the next cycle. PLC logic design synchronization is achieved by using pulse signals to control the output and internal state transitions. The execution of instructions is effective only during the pulse cycle. Moreover, during the pulse cycle, the execution result of the preceding instruction does not change the execution condition of the following instruction [4]. There are many synchronization methods. In Figure 2, synchronization is achieved by arranging the order of instructions. In Figure 2, when the system is powered on, the high-speed timer starts timing. After 10ms, its normally closed contact opens, that is, T0 outputs a pulse with a width of one scan cycle. When the first pulse arrives, 6.04 is set, becoming the execution condition of the previous line's instruction. However, its instruction has already been executed, so there will be no change during the pulse. Similarly, after the fourth pulse, 6.07 is set, and 6.06 is reset, becoming the output condition of the working register W0.00. When the fifth pulse arrives, 6.07 is reset, and the ladder diagram returns to the initial state. This process is repeated, and the four-bit data terminals 6.04 to 6.07 are turned on in turn for 10ms. [align=center] Figure 2 Generation of Strobe Signal[/align] 2.4 Data Display The MOVD instruction is used to display one word of internal data, such as DM area, W area, T/C area, etc., through channel 6. As shown in Figure 3, in this example, the data in D0 is displayed by selecting different bits according to different strobe signals. [align=center] Figure 3 Data Display Output[/align] 3 Function Extension 3.1 Displaying Double Words In Figure 1, PLC input terminal 0.01 is connected to DIP switch SA. Its function depends on its position and combined with jump instructions (JMP/JME) to determine which channel the data is displayed on. As shown in Figure 4, when SA is ON, the data in D0 is displayed; when SA is OFF, the data in D1 is displayed. [align=center] Figure 4 Dual-word data display output[/align] 3.2 Hardware expansion If the four selected output points 6.00~6.03 are decoded by a 4-line to 16-line decoder (such as SG74HC154), they can be expanded into 16 cyclic selected signals, which can display the data of 4 channels. If combined with switch SA, as shown in Figure 4, the data of 8 channels can be displayed. 5 Conclusion This article takes the CJ1M series PLC as an example, using 9 I/O points (1 input, 8 outputs) combined with software programming and hardware expansion to display the data of 8 internal channels (128 bits). Practice has proven that this method is simple, reliable, and inexpensive, and is suitable for experimental teaching and engineering field operation. References [1] Yang Gongyuan. Programmable Logic Controller Principles and Applications. Beijing: Electronic Industry Press, 2004 [2] Zhan Huaqun, Peng Jianfei. A novel LED dynamic display method. Today's Electronics, 2003 (2): 43~46. [3] Qi Wenli, Huo Gang. Application Fundamentals and Cases of CS/CJ Series PLC. Beijing: Machinery Industry Press, 2006. [4] Song Baisheng. PLC Programming Theory, Algorithms and Techniques. Beijing: Machinery Industry Press, 2005. Suggestions for Omron: The user manual should be revised and improved to reduce errors; after-sales service should be timely and in place; more professional training should be conducted.