The working principle of PLC

The working principle of PLC

Here, the basic operations common to SYSMAC PLC of our company's PLC (Programmable Controller) are explained to the customers who have used our PLC for the first time with the necessary terminology. However, it does not include the technical information required for your FA system and PLC programming after purchase.

I/O refresh

In a PLC (Programmable Logic Controller), a user program designed by a customer is executed by reading and writing instructions from the beginning to the end one by one while reading and writing information in a memory area in the PLC (Omron calls "I/O memory"). deal with. On the other hand, data outside the PLC, such as sensors/switches directly connected to the PLC or I/O unit, is updated along with the data of the I/O memory in the PLC at a certain timing. This kind of data outside the PLC is updated together with the data of the I/O memory in the PLC, which is called "I/O refresh operation."

It is very important to understand the timing of I/O refresh according to customer's design of FA system and user program. In the case of SYSMAC PLC, this I/O refresh operation is performed immediately after all instructions have been executed. (See the figure below)

period time

In the PLC processing cycle, the time from the I/O refresh execution (start) to the next I/O refresh execution (processing), that is, the cycle time.

The cycle time includes the time required for common processing (self-diagnosis), user program execution processing, I/O refresh processing, peripheral service processing, and the like.

1 If the cycle time is too long, the period for updating the data with the PLC becomes longer, and the response time of the input/output becomes longer, making it impossible to obtain changes in the input shorter than the cycle time.
2 If the cycle time is short, the input/output response time becomes shorter and high-speed processing is possible.
3 If you change the cycle time, the execution interval of the command and the response time of the input and output will also change.

In the case of SYSMAC PLC, the following steps can be used to calculate the cycle time.
Cycle time = common processing time + instruction execution time + I/O refresh time + peripheral service time
The calculation method for the execution time of each SYSMAC PLC model is described in the product manual.

Interrupt task

Usually, during the processing cycle of the PLC, the user program includes other processes such as I/O refresh and will be executed sequentially. (See "I/O Refresh" item).
The processing that can be prioritized in this processing cycle is interrupting the job. If the interrupt condition specified in advance is satisfied, the processing cycle is interrupted and the processing is executed preferentially.
(Depending on the type of SYSMAC PLC, the "interrupt task" may also be referred to as an "interrupt program". This article uses the representation of the "interrupt task" used in the CS/CJ series).
For example, in the SYSMAC CS/CJ series, as an interrupt task, it is possible to provide a power-off interrupt, a timer interrupt, an I/O interrupt, a constant-period interrupt by an internal timer, and an external interrupt.

The main interrupt task content
Power interruption interrupted when power is cut off
Timing interrupts are performed at regular intervals
I/O interrupt Execution of external interrupt at contact rising edge of interrupt input unit Execution from request from high-function I/O unit, CPU high-function unit, interposer (CS series only)

I/O allocation

In the user program, it is necessary to assign the address of the I/O memory in the PLC in advance in order to process the input and output signals of the I/O units loaded in the PLC. Allocating the input and output signals of the units loaded in the PLC to the I/O memory is assigned to the I/O. The CPU unit executes the load unit and I/O refresh operation based on the I/O allocation information.
Allocating the input and output signals of the units loaded in the PLC to the I/O memory is assigned to the I/O. The CPU unit executes the load unit and I/O refresh operation based on the I/O allocation information.


Automatic login online

CPU unit storage area

In the PLC, various types of data such as user programs, I/O memory data and comment information, CPU unit and high-function unit setting information, and registered I/O table information are processed. The place where all the data processed by these PLCs is stored is the storage area in the CPU unit.

In the SYSMAC PLC, there are the following three kinds of memory areas, which are supported by the battery.
In addition, in the SYSMAC CS/CJ series, since the built-in flash memory is used, the contents of the storage area can be supported. Even if the voltage of the battery is reduced, the data of the user program and the parameter area will not disappear.


The user program area records the user program designed by the customer.

The I/O memory area can access this area by the instruction's opcode. Recording Channel I/O (CIO), Internal Auxiliary Relay, Holding Relay, Special Auxiliary Relay, Data Memory, Extended Data Memory, Timing Completion Flag, Current Value, Count Completion Flag, Current Value, Task Flag, Index Register, Data Register Information, condition registers, clock pulses, etc.
The data in the I/O memory area includes the area where the contents are cleared when the power is turned off and the area where the previous information can be maintained.

Parameter area
Various initial setting information handled by the PLC.
Records information such as PLC system settings, login I/O tables, routing tables, and CPU high-function unit system settings.