The process of PLC program execution

Aug 02, 2024 Leave a message

PLC beginners, learning to program, first of all, to understand what the process of PLC program execution.


PLC program execution is divided into three phases: input sampling phase, program execution phase, input refresh phase. PLC has been cycling through these three phases, the execution of one time, it is called a scanning cycle.


1.input sampling phase: PLC scans the state of all input terminals, and saved to the input image memory, such as 10.0, 10.1 and other terminals are connected or disconnected state. Then enter the next stage, in the program execution stage and the output refresh stage, the input image register is isolated from the outside world, it is kept inside the state of each point remains unchanged. It is not until the input sampling phase of the next scan cycle that the new state on the input terminals is accessed and updated. Therefore, when the PLC is executed, the state of each input point is retrieved from the input image memory and not directly from the on/off state of the physical terminals. For this reason, the input signals have a wide bandwidth of more than one scan cycle. For example, if a button is connected to one of the inputs, the time it takes for the button to be pressed is greater than one scan cycle. Why? If the button is pressed for a very short time, and you are not in the input sampling phase when you press it, you won't be able to capture the input signal. Of course, this is theoretically speaking, because, PLC a scan cycle time is very short, a dozen millimeters or tens of millimeters, perhaps you do not feel it at all.

 

2, program execution stage: PLC from left to right, from top to bottom scanning execution of the user program, of course, according to the requirements of different instructions within the program, such as encountering the jump instruction in accordance with the steps specified in the jump instruction execution. When the instruction encounters an input condition, the input state is retrieved from the input image memory. When the result of the operation is output, the output state is stored in the output image memory.


3, Output Refresh Phase: After all instructions are executed, the state of all output relays in the component image registers is turned on/off in the output refresh phase and stored in the output latches, which are used to drive external loads through the output terminals and external power supply.

Send Inquiry

whatsapp

Phone

E-mail

Inquiry