# US 9,618,924 B2 · CPU of PLC, system program for PLC, and recording medium storing system program for PLC

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 9,618,924 B2
- Document ID: US9618924B2
- Status: Granted
- Kind: B2
- Application number: 14/017,904
- Filed: 2013-09-04
- Published: 2014-01-02
- Granted: 2017-04-11
- Earliest claimed: 2011-03-15
- Assignees: OMRON Corporation
- Applicants: Omron Corporation
- Inventors: Yoshihide Nishiyama; Shigeyuki Eguchi; Osamu Hamasaki; Tatsuya Kojima
- Web page: https://patentgrep.com/patent/US9618924B2

## CPC

- G05B 19/05: Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G06F 9/526: {Mutual exclusion algorithms}
- G06F 9/54: Interprogram communication
- G06F 9/544: {Buffers; Shared memory; Pipes}
- G05B 2219/13005: Subroutine
- G05B 2219/13067: Use of variables, symbols in instructions, to indicate mechanisms, interfaces
- G06F 2209/523: Mode
- G05B: CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS (systems for controlling or regulating non-electric variables G05D; systems for regulating electric or magnetic variables G05F; control devices or systems insofar as characterised by mechanical features only G05G)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The system program includes, as an execution control process of the control program, an owner-side start process that starts execution of an owner-side control program; a copy process in which, when execution of the owner-side control program ends, a global variable that is rewritten by the owner-side control program is copied from a global variable area to a synchronous buffer corresponding to the global variable; and a referrer-side start process that starts execution of a referrer-side control program.

## Claims

### Claim 1

A CPU of a programmable logic controller (PLC) controlling a control target, comprising:
a microprocessor;
a memory; and
a communication circuit, wherein
the CPU of the PLC is configured to control the control target by repeating transmission of output data, reception of input data, and execution of a plurality of control programs that uses the input data to generate the output data,
the memory stores the plurality of control programs, a system program that controls the execution of the plurality of control programs, and attribute data of a variable that is used by the plurality of control programs,
the microprocessor is configured to execute the system program and the plurality of control programs that are stored in the memory,
the communication circuit is configured to transmit the output data and receives the input data,
the attribute data include, when the variable is a global variable that is referenced by the plurality of the control programs, information specifying one owner-side control program that rewrites the variable and information specifying at least one referrer-side control program that only references the variable,
the system program is configured to cause the microprocessor to execute, as an execution preparation process of the plurality of control programs,
a process in which a global variable area storing the global variable is generated in the memory; and
a process in which, with respect to each referrer-side control program and for each global variable that is referenced by the referrer-side control program, a synchronous buffer is generated in the memory as a reference destination in place of the global variable area when the referrer-side control program references the global variable,
the system program is configured to cause the microprocessor to execute, as an execution control process of the plurality of control programs,
an owner-side start process that starts execution of the owner-side control program;
a copy process in which, when execution of the owner-side control program ends, the global variable that is rewritten by the owner-side control program is copied from the global variable area to the synchronous buffer corresponding to the global variable; and
a referrer-side start process that starts execution of the referrer-side control program,
wherein the plurality of control programs in the PLC are able to reference the global variable for which consistency is ensured, without a need of a control program of the plurality of control programs performing processing to ensure consistency of the global variable and without blocking concurrent execution of the plurality of control programs.

### Claim 2 (depends on 1)

The CPU of a PLC according to claim 1, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced by the referrer-side control program, a first synchronous buffer and a second synchronous buffer are generated as a group of synchronous buffers,
the first synchronous buffer and the second synchronous buffer are each set to, in a non-overlapping manner, one of a write destination state in which the global variable is copied from the global variable area to the synchronous buffer and a reference destination state in which the synchronous buffer is referenced from the referrer-side control program, and
the copy process is a process of copying to the synchronous buffer in the write destination state.

### Claim 3 (depends on 2)

The CPU of the PLC according to claim 2, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, the first synchronous buffer, the second synchronous buffer and a third synchronous buffer are generated as a group of synchronous buffers,
the first synchronous buffer, the second synchronous buffer and the third synchronous buffer are each set to, in a non-overlapping manner, one of the write destination state, the reference destination state and a standby state,
the copy process further includes a first interchange process in which the write destination state and the standby state of the synchronous buffer in the write destination state that becomes a copy destination and the synchronous buffer in the standby state that is in the same group as the synchronous buffer in the write destination state are interchanged, and
the referrer-side start process further includes a second interchange process in which, with respect to the synchronous buffers of the referrer-side control program of which execution is started, under a condition that the synchronous buffer storing latest data is in the standby state, the standby state and the reference destination state of the synchronous buffer in the standby state and the synchronous buffer in the reference destination state are interchanged.

### Claim 4 (depends on 3)

The CPU of the PLC according to claim 3, wherein
the system program is further configured to cause the microprocessor to execute, as the execution preparation process of the plurality of control programs, a process in which, for each combination of the owner-side control program and the referrer-side control program that are associated by the global variable, a latest data update flag is generated in the memory,
the copy process further includes a process in which the latest data update flag related to this copy process is set to ON,
the referrer-side start process further includes, under a condition that the latest data update flag related to the synchronous buffer of the referrer-side control program of which execution is started is ON, the second interchange process and a process in which the latest data update flag is set to OFF, and
thereby, the second interchange process that is executed under a condition that the synchronous buffer storing latest data is in the standby state is realized.

### Claim 5 (depends on 3)

The CPU of the PLC according to claim 3, wherein
the system program is further configured to cause the microprocessor to execute, as the execution preparation process of the plurality of control programs, a process in which a latest state recording area is generated in the memory,
the copy process further includes a process in which that the synchronous buffer as the copy destination is in a latest state is recorded in the latest state recording area, and
the referrer-side start process further includes the second interchange process that is executed under a condition that the synchronous buffer in the latest state that is identified according to content of the latest state recording area is in the standby state.

### Claim 6 (depends on 2)

The CPU of the PLC according to claim 2, wherein
the referrer-side start process further includes, with respect to the synchronous buffers of the referrer-side control program of which execution is started, under a condition that the synchronous buffer storing latest data is in the write destination state, an interchange process in which the write destination state and the reference destination state of the synchronous buffer in the write destination state and the synchronous buffer in the reference destination state are interchanged.

### Claim 7 (depends on 6)

The CPU of the PLC according to claim 6, wherein
the system program is further configured to cause the microprocessor to execute, as the execution preparation process of the plurality of control programs, a process in which, for each combination of the owner-side control program and the referrer-side control program that are associated by the global variable, the latest data update flag is generated in the memory,
the copy process further includes a process in which the latest data update flag related to this copy process is set to ON,
the referrer-side start process further includes, under a condition that the latest data update flag related to the synchronous buffer of the referrer-side control program of which execution is started is ON, the interchange process and a process in which the latest data update flag is set to OFF, and
thereby, the third interchange process that is executed under a condition that the synchronous buffer storing latest data is in the write destination state is realized.

### Claim 8 (depends on 6)

The CPU of the PLC according to claim 6, wherein
the system program is further configured to cause the microprocessor to execute, as the execution preparation process of the plurality of control programs, a process in which a latest state recording area is generated in the memory,
the copy process further includes a process in which that the synchronous buffer as the copy destination is in a latest state is recorded in the latest state recording area, and
the referrer-side start process further includes the third interchange process that is executed under a condition that the synchronous buffer in the latest state that is identified according to content of the latest state recording area is in the write destination state.

### Claim 9 (depends on 1)

The CPU of the PLC according to claim 1, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, a first synchronous buffer and a second synchronous buffer are generated as a group of synchronous buffers,
the system program is further configured to cause the microprocessor to execute, as the execution preparation process of the plurality of control programs, a process in which a latest state recording area is generated in the memory,
the copy process further includes a process in which that the synchronous buffer as a copy destination is in a latest state is recorded in the latest state recording area, and
the referrer-side start process further includes a process in which the synchronous buffer in the latest state that is identified according content of the latest state recording area is set to a reference destination state in which the synchronous buffer is referenced by the referrer-side control program during execution.

### Claim 10 (depends on 9)

The CPU of the PLC according to claim 9, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced by the referrer-side control program, the first synchronous buffer, the second synchronous buffer and a third synchronous buffer are generated as a group of synchronous buffers,
the first synchronous buffer, the second synchronous buffer and the third synchronous buffer are each set to, in a non-overlapping manner, one of a write destination state in which the global variable is copied from the global variable area, the reference destination state and a standby state,
the copy process is a process of copying to the synchronous buffer in the write destination state and further includes a first interchange process in which the write destination state and the standby state of the synchronous buffer in the write destination state that becomes the copy destination and the synchronous buffer in the standby state that is in the same group as the synchronous buffer as the copy destination are interchanged, and
the referrer-side start process further includes a process in which the synchronous buffer that belongs to the same group as the synchronous buffer in the reference destination state and is not in the write destination state is set to the standby state.

### Claim 11 (depends on 9)

The CPU of the PLC according to claim 9, wherein
the first synchronous buffer and the second synchronous buffer are set to, in a non-overlapping manner, one of the write destination state in which the global variable is copied from the global variable area and the reference destination state,
the copy process is a process of copying to the synchronous buffer in the write destination state, and
the referrer-side start process further includes a process in which the other synchronous buffer that belongs to the same group as the synchronous buffer in the reference destination state is set to the write destination state.

### Claim 12 (depends on 9)

The CPU of the PLC according to claim 9, wherein
the referrer-side start process further includes a process in which the synchronous buffer in the latest state that is identified according content of the latest state recording area is set to a write-protect state,
the system program is further configured to cause the microprocessor to execute, as the execution control process of the plurality of control programs, a write-protect release process in which, when execution of the referrer-side control program ends, the write-protect state of the synchronous buffer that was in the write-protect state is released, and
the copy process is a process in which copying is performed using one of the first synchronous buffer and the second synchronous buffer that is not in the write-protect state as a copy destination.

### Claim 13 (depends on 1)

The CPU of the PLC according to claim 1, wherein
the referrer-side start process further includes a process in which the synchronous buffer that is referenced during execution of the referrer-side control program is set to a write-protect state,
the system program is configured to cause the microprocessor to execute, as the execution control process of the plurality of control programs, a write-protect release process in which, when execution of the referrer-side control program ends, the write-protect state of the synchronous buffer that was in the write-protect state is released, and
the copy process is a process that is executed under a condition that the synchronous buffer as a copy destination is not in the write-protect state.

### Claim 14 (depends on 13)

The CPU of the PLC according to claim 13, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, one synchronous buffer is generated.

### Claim 15 (depends on 13)

The CPU of a PLC according to claim 13, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, a first synchronous buffer and a second synchronous buffer are generated as a group of synchronous buffers,
the system program is further configured to cause the microprocessor to execute, as the execution preparation process of the plurality of control programs, a process in which a latest state recording area is generated in the memory,
the copy process is a process in which copying is performed using one of the first synchronous buffer and the second synchronous buffer that is not in the write-protect state as a copy destination, and further includes a process in which that the synchronous buffer as the copy destination is in a latest state is recorded in the latest state recording area, and
the referrer-side start process further includes a process in which the synchronous buffer in the latest state that is identified according to content of the latest state recording area is set to the reference destination state in which the synchronous buffer is referenced during execution of the referrer-side control program.

### Claim 16 (depends on 1)

The CPU of a PLC according to claim 1, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, a first synchronous buffer and a second synchronous buffer are generated as a group of synchronous buffers,
the second synchronous buffer is the synchronous buffer that is a reference destination when the referrer-side control program references the global variable,
the copy process is a process of copying to the first synchronous buffer, and
the referrer-side start process further includes a process in which data stored in the first synchronous buffer is copied to the second synchronous buffer.

### Claim 17

A programmable logic controller (PLC) system including a program being stored in a memory to be executed by a microprocessor in a CPU of the PLC, the CPU comprising the microprocessor, the memory and a communication circuit and controlling a control target by repeating transmission of output data, reception of input data and execution of a plurality of control programs that uses the input data to generate the output data, wherein
the memory stores the plurality of control programs, the system program that controls the execution of the plurality of control programs, and attribute data of a variable that is used by the plurality of control programs,
the microprocessor is configured to execute, in addition to the system program, the plurality of control programs,
the communication circuit is configured to transmit the output data and receives the input data,
the attribute data include, when the variable is a global variable that is referenced by a plurality of the control programs, information specifying one owner-side control program that rewrites the variable and information specifying at least one referrer-side control program that only references the variable,
the system program is configured to cause the microprocessor to execute, as an execution preparation process of the plurality of control programs,
a process in which a global variable area storing the global variable is generated in the memory; and
a process in which, with respect to each referrer-side control program and for each global variable that is referenced by the referrer-side control program, a synchronous buffer is generated in the memory as a reference destination in place of the global variable area when the referrer-side control program references the global variable, and
the system program is configured to cause the microprocessor to execute, as an execution control process of the plurality of control programs,
an owner-side start process that starts execution of the owner-side control program;
a copy process in which, when execution of the owner-side control program ends, the global variable that is rewritten by the owner-side control program is copied from the global variable area to the synchronous buffer corresponding to the global variable; and
a referrer-side start process that starts execution of the referrer-side control program,
wherein the plurality of control programs in the PLC are able to reference the global variable for which consistency is ensured, without a need of a control program of the plurality of control programs performing processing to ensure consistency of the global variable and without blocking concurrent execution of the plurality of control programs.

### Claim 18 (depends on 17)

The system according to claim 17, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced by the referrer-side control program, a first synchronous buffer and a second synchronous buffer are generated as a group of synchronous buffers,
the first synchronous buffer and the second synchronous buffer are each set to, in a non-overlapping manner, one of a write destination state in which the global variable is copied from the global variable area to the synchronous buffer and a reference destination state in which the synchronous buffer is referenced from the referrer-side control program, and
the copy process is a process of copying to the synchronous buffer in the write destination state.

### Claim 19 (depends on 18)

The system according to claim 18, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, the first synchronous buffer, the second synchronous buffer and a third synchronous buffer are generated as a group of synchronous buffers,
the first synchronous buffer, the second synchronous buffer and the third synchronous buffer are each set to, in a non-overlapping manner, one of the write destination state, the reference destination state and a standby state,
the copy process further includes a first interchange process in which the write destination state and the standby state of the synchronous buffer in the write destination state that becomes a copy destination and the synchronous buffer in the standby state that is in the same group as the synchronous buffer in the write destination state are interchanged, and
the referrer-side start process further includes a second interchange process in which, with respect to the synchronous buffers of the referrer-side control program of which execution is started, under a condition that the synchronous buffer storing latest data is in the standby state, the standby state and the reference destination state of the synchronous buffer in the standby state and the synchronous buffer in the reference destination state are interchanged.

### Claim 20 (depends on 18)

The system according to claim 18, wherein
the referrer-side start process further includes, with respect to the synchronous buffers of the referrer-side control program of which execution is started, under a condition that the synchronous buffer storing latest data is in the write destination state, an interchange process in which the write destination state and the reference destination state of the synchronous buffer in the write destination state and the synchronous buffer in the reference destination state are interchanged.

### Claim 21 (depends on 17)

The system according to claim 17, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, a first synchronous buffer and a second synchronous buffer are generated as a group of synchronous buffers,
the system program is further configured to cause the microprocessor to further execute, as the execution preparation process of the plurality of control programs, a process in which a latest state recording area is generated in the memory,
the copy process further includes a process in which that the synchronous buffer as a copy destination is in a latest state is recorded in the latest state recording area, and
the referrer-side start process further includes a process in which the synchronous buffer in the latest state that is identified according content of the latest state recording area is set to a reference destination state in which the synchronous buffer is referenced by the referrer-side control program during execution.

### Claim 22 (depends on 17)

The system according to claim 17, wherein
the referrer-side start process further includes a process in which the synchronous buffer that is referenced during execution of the referrer-side control program is set to a write-protect state,
the system program is further configured to cause the microprocessor to further execute, as the execution control process of the plurality of control programs, a write-protect release process in which, when execution of the referrer-side control program ends, the write-protect state of the synchronous buffer that was in the write-protect state is released, and
the copy process is a process that is executed under a condition that the synchronous buffer as a copy destination is not in the write-protect state.

### Claim 23 (depends on 17)

The system according to claim 17, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, a first synchronous buffer and a second synchronous buffer are generated as a group of synchronous buffers,
the second synchronous buffer is the synchronous buffer that is a reference destination when the referrer-side control program references the global variable,
the copy process is a process of copying to the first synchronous buffer, and
the referrer-side start process further includes a process in which data stored in the first synchronous buffer is copied to the second synchronous buffer.

### Claim 24

A recording medium storing a system program for a programmable logic controller (PLC), the system program being stored in a memory to be executed by a microprocessor in a CPU of the PLC, the CPU comprising the microprocessor, the memory and a communication circuit and controlling a control target by repeating transmission of output data, reception of input data, and execution of a plurality of control programs that uses the input data to generate the output data, wherein
the memory stores the plurality of control programs, the system program that controls the execution of the plurality of control programs, and attribute data of a variable that is used by the control program,
the microprocessor is configured to execute, in addition to the system program, the plurality of control programs,
the communication circuit is configured to transmit the output data and receives the input data,
the attribute data include, when the variable is a global variable that is referenced by a plurality of the control programs, information specifying one owner-side control program that rewrites the variable and information specifying at least one referrer-side control program that only references the variable,
the system program is configured to cause the microprocessor to execute, as an execution preparation process of the plurality of control programs,
a process in which a global variable area storing the global variable is generated in the memory; and
a process in which, with respect to each referrer-side control program and for each global variable that is referenced by the referrer-side control program, a synchronous buffer is generated in the memory as a reference destination in place of the global variable area when the referrer-side control program references the global variable, and
the system program is configured to cause the microprocessor to execute, as an execution control process of the plurality of control programs,
an owner-side start process that starts execution of the owner-side control program;
a copy process in which, when execution of the owner-side control program ends, the global variable that is rewritten by the owner-side control program is copied from the global variable area to the synchronous buffer corresponding to the global variable; and
a referrer-side start process that starts execution of the referrer-side control program,
wherein the plurality of control programs in the PLC are able to reference the global variable for which consistency is ensured, without a need of a control program of the plurality of control programs performing processing to ensure consistency of the global variable and without blocking concurrent execution of the plurality of control programs.

### Claim 25 (depends on 24)

The recording medium storing the system program for the PLC according to claim 24, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced by the referrer-side control program, a first synchronous buffer and a second synchronous buffer are generated as a group of synchronous buffers,
the first synchronous buffer and the second synchronous buffer are each set to, in a non-overlapping manner, one of a write destination state in which the global variable can be copied from the global variable area to the synchronous buffer and a reference destination state in which the synchronous buffer is referenced from the referrer-side control program, and
the copy process is a process of copying to the synchronous buffer in the write destination state.

### Claim 26 (depends on 25)

The recording medium storing the system program for the PLC according to claim 25, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, the first synchronous buffer, the second synchronous buffer and a third synchronous buffer are generated as a group of synchronous buffers,
the first synchronous buffer, the second synchronous buffer and the third synchronous buffer are each set to, in a non-overlapping manner, one of the write destination state, the reference destination state and a standby state,
the copy process further includes a first interchange process in which the write destination state and the standby state of the synchronous buffer in the write destination state that becomes a copy destination and the synchronous buffer in the standby state that is in the same group as the synchronous buffer in the write destination state are interchanged, and
the referrer-side start process further includes a second interchange process in which, with respect to the synchronous buffers of the referrer-side control program of which execution is started, under a condition that the synchronous buffer storing latest data is in the standby state, the standby state and the reference destination state of the synchronous buffer in the standby state and the synchronous buffer in the reference destination state are interchanged.

### Claim 27 (depends on 25)

The recording medium storing the system program for the PLC according to claim 25, wherein
the referrer-side start process further includes, with respect to the synchronous buffers of the referrer-side control program of which execution is started, under a condition that the synchronous buffer storing latest data is in the write destination state, an interchange process in which the write destination state and the reference destination state of the synchronous buffer in the write destination state and the synchronous buffer in the reference destination state are interchanged.

### Claim 28 (depends on 24)

The recording medium storing the system program for the PLC according to claim 24, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, a first synchronous buffer and a second synchronous buffer are generated as a group of synchronous buffers,
the system program is further configured to cause the microprocessor to further execute, as the execution preparation process of the plurality of control programs, a process in which a latest state recording area is generated in the memory,
the copy process further includes a process in which that the synchronous buffer as a copy destination is in a latest state is recorded in the latest state recording area, and
the referrer-side start process further includes a process in which the synchronous buffer in the latest state that is identified according content of the latest state recording area is set to a reference destination state in which the synchronous buffer is referenced by the referrer-side control program during execution.

### Claim 29 (depends on 24)

The recording medium storing the system program for the PLC according to claim 24, wherein
the referrer-side start process further includes a process in which the synchronous buffer that is referenced during execution of the referrer-side control program is set to a write-protect state,
the system program is further configured to cause the microprocessor to further execute, as the execution control process of the plurality of control programs, a write-protect release process in which, when execution of the referrer-side control program ends, the write-protect state of the synchronous buffer that was in the write-protect state is released, and
the copy process is a process that is executed under a condition that the synchronous buffer as a copy destination is not in the write-protect state.

### Claim 30 (depends on 24)

The recording medium storing the system program for the PLC according to claim 24, wherein
the process in which the synchronous buffer is generated is a process in which, with respect to each referrer-side control program and for each global variable that is referenced from the referrer-side control program, a first synchronous buffer and a second synchronous buffer are generated as a group of synchronous buffers,
the second synchronous buffer is the synchronous buffer that is a reference destination when the referrer-side control program references the global variable,
the copy process is a process of copying to the first synchronous buffer, and
the referrer-side start process further includes a process in which data stored in the first synchronous buffer is copied to the second synchronous buffer.
