News Category>>
How programmable controllers (PLCs) work
The PLC uses a serial cyclic scan mode of operation. The so-called scan means that the CPU starts executing the program from the first instruction until the last instruction (end instruction). The scanning process is roughly divided into the following three phases.
(1) Input sampling stage
In the input sampling stage, the PLC first reads the on/off status or input data of all input terminals in order and deposits (writes) them into the corresponding input status registers, i.e. refreshes them.In the input sampling phase, the PLC first reads the on/off status or input data of all the input terminals in sequence and stores (writes) them into the corresponding input status registers, i.e. refreshes the inputs. The input port is then closed and the program execution phase begins. During the execution phase, even if the input status changes, the contents of the input status registers remain unchanged.The contents of the input status registers are not changed during the execution phase. The changed input signal status can only be read in during the sampling phase of the next scan cycle.
The PLC manufacturers for the relay control circuit (electrical control schematic), the characteristics of the development of a simple and easy to learn ladder, this programming language has the characteristics of image and intuitive. In the user program implementation stage, the CPU will be called out one by one and the implementation of instructions, the process is from the ladder diagram of the first ladder level from top to bottom in order to scan the user program, in each ladder level, and always according to the first left after the right, first up and then down the order of scanning the user program. Ladder instructions are instructions that correspond to the conditions on the ladder diagram. Each instruction requires one line of helper code and the program is stored in memory in helper form. During the execution of the instruction, the status and data are read from the input image register or the output image register, and logical and arithmetic operations are performed in accordance with the instruction, the results of which are stored in the corresponding cells in the output image register area. At this stage, except for the content of the input image register remains unchanged, the content of other image registers will change with the execution of the program, and the execution result of the ladder instruction at the top will work on the ladder instruction of the state or data that is used at the bottom.
(3) Output Refresh Phase
When all instructions have been executed, the on/off status of the output status register is sent to the output in the output refresh phase and output by certain means (relay, transistor or Thyristor, etc.) output, drive the corresponding output devices, which is the actual output of the PLC.After these three phases, a scan cycle is completed. The length of the scan cycle with the user program and the number of instructions and the time required to implement each instruction, generally no more than 100ms.
(1) Input sampling stage
In the input sampling stage, the PLC first reads the on/off status or input data of all input terminals in order and deposits (writes) them into the corresponding input status registers, i.e. refreshes them.In the input sampling phase, the PLC first reads the on/off status or input data of all the input terminals in sequence and stores (writes) them into the corresponding input status registers, i.e. refreshes the inputs. The input port is then closed and the program execution phase begins. During the execution phase, even if the input status changes, the contents of the input status registers remain unchanged.The contents of the input status registers are not changed during the execution phase. The changed input signal status can only be read in during the sampling phase of the next scan cycle.
(2) User program execution phase
The PLC manufacturers for the relay control circuit (electrical control schematic), the characteristics of the development of a simple and easy to learn ladder, this programming language has the characteristics of image and intuitive. In the user program implementation stage, the CPU will be called out one by one and the implementation of instructions, the process is from the ladder diagram of the first ladder level from top to bottom in order to scan the user program, in each ladder level, and always according to the first left after the right, first up and then down the order of scanning the user program. Ladder instructions are instructions that correspond to the conditions on the ladder diagram. Each instruction requires one line of helper code and the program is stored in memory in helper form. During the execution of the instruction, the status and data are read from the input image register or the output image register, and logical and arithmetic operations are performed in accordance with the instruction, the results of which are stored in the corresponding cells in the output image register area. At this stage, except for the content of the input image register remains unchanged, the content of other image registers will change with the execution of the program, and the execution result of the ladder instruction at the top will work on the ladder instruction of the state or data that is used at the bottom.
(3) Output Refresh Phase
When all instructions have been executed, the on/off status of the output status register is sent to the output in the output refresh phase and output by certain means (relay, transistor or Thyristor, etc.) output, drive the corresponding output devices, which is the actual output of the PLC.After these three phases, a scan cycle is completed. The length of the scan cycle with the user program and the number of instructions and the time required to implement each instruction, generally no more than 100ms.

2023-01-09
View:205
Back
Links:

