PROGRAM CREATION SUPPORT DEVICE, PROGRAM CREATION SUPPORT METHOD, AND STORAGE MEDIUM
20220155746 · 2022-05-19
Assignee
Inventors
Cpc classification
Y02P90/02
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
International classification
Abstract
A program creation support device including a control unit internally having a first memory and controlling the programmable logic controller having a refresh function and a network unit internally having a second memory and acquiring data from a device to be controlled and storing the data in the second memory. The support device includes: a program extraction unit extracting a description indicating access to the second memory from a pre-conversion sequence program before being converted into a format understandable by the programmable logic controller; a storage unit storing memory allocation setting information indicating a relationship between a specific region of the first memory and a specific region of the second memory; and a program replacement unit replacing a description indicating access to the second memory in the pre-conversion sequence program with a description indicating access to the first memory based on the memory allocation setting information.
Claims
1. A program creation support device that supports creation of a sequence program to be executed by a programmable logic controller including a controller and a network controller, the controller having a first memory and controlling an operation of the programmable logic controller as a whole, the network controller having a second memory and acquiring data from a device to be controlled by the programmable logic controller to store the data in the second memory, the programmable logic controller having a refresh function of synchronizing a value of a specific region of the first memory with a value of a specific region of the second memory, the program creation support device comprising: program extraction circuitry to extract a description indicating access to the second memory from a pre-conversion sequence program that is a sequence program before being converted into a format understandable by the programmable logic controller; a memory to store memory allocation setting information indicating a correspondence relationship between the specific region of the first memory and the specific region of the second memory; and program replacement circuitry to replace a description indicating access to the second memory in the pre-conversion sequence program with a description indicating access to the first memory on the basis of the memory allocation setting information stored in the memory.
2. The program creation support device according to claim 1, wherein: the memory allocation setting information indicates to which region of the second memory each of regions where a value is updated by the refresh function, among regions of the first memory, is allocated.
3. The program creation support device according to claim 1, further comprising: memory allocation circuitry to allocate regions of the first memory to respective regions of the second memory indicated by respective descriptions extracted by the program extraction circuitry to generate the memory allocation setting information.
4. The program creation support device according to claim 1, further comprising: information acquisition circuitry to acquire information on a region that can be referred to by the controller among regions of the second memory; and memory allocation circuitry to allocate a region of the first memory to a region of the second memory indicated by information acquired by the information acquisition circuitry to generate the memory allocation setting information.
5. The program creation support device according to claim 3, wherein: the programmable logic controller includes two or more network controllers including the network controller and being equivalent to the network controller, and the memory allocation circuitry generates memory allocation setting information for each of these network controllers.
6. The program creation support device according to claim 3, wherein: the specific region of the first memory and the specific region of the second memory are constituted by a plurality of regions, and the memory allocation circuitry generates the memory allocation setting information such that each of regions constituting the specific region of the first memory is not redundantly allocated to the plurality of regions constituting the specific region of the second memory.
7. The program creation support device according to claim 3, wherein: the memory allocation circuitry selects the specific region of the first memory from a range designated in advance by a user among regions of the first memory, and associates the specific region of the first memory with the specific region of the second memory.
8. The program creation support device according to claim 3, wherein: the memory allocation circuitry selects the specific region of the first memory from a range designated in advance by a manufacturer of the programmable logic controller among regions of the first memory, and associates the specific region of the first memory with the specific region of the second memory.
9. A program creation support method that supports creation of a sequence program to be executed by a programmable logic controller including a controller and a network controller, the controller having a first memory and controlling an operation of the programmable logic controller as a whole, the network controller having a second memory and acquiring data from a device to be controlled by the programmable logic controller to store the data in the second memory, the programmable logic controller having a refresh function of synchronizing a value of a specific region of the first memory with a value of a specific region of the second memory, the program creation support method comprising: extracting a description indicating access to the second memory from a pre-conversion sequence program that is a sequence program before being converted into a format understandable by the programmable logic controller; storing, in a memory, memory allocation setting information indicating a correspondence relationship between the specific region of the first memory and the specific region of the second memory; and replacing, a description indicating access to the second memory in the sequence program with a description indicating access to the first memory on the basis of the memory allocation setting information stored in the storage memory.
10. A non-transitory computer readable medium for storing therein a program that supports creation of a sequence program to be executed by a programmable logic controller including a controller and a network controller, the controller having a first memory and controlling an operation of the programmable logic controller as a whole, the network controller having a second memory and acquiring data from a device to be controlled by the programmable logic controller to store the data in the second memory, the programmable logic controller having a refresh function of synchronizing a value of a specific region of the first memory with a value of a specific region of the second memory, the program causing a computer to execute: extracting a description indicating access to the second memory from a pre-conversion sequence program that is a sequence program before being converted into a format understandable by the programmable logic controller; storing, in a memory, memory allocation setting information indicating a correspondence relationship between the specific region of the first memory and the specific region of the second memory; and replacing a description indicating access to the second memory in the sequence program with a description indicating access to the first memory on the basis of the memory allocation setting information stored in the storage unit memory.
11. The program creation support device according to claim 4, wherein: the programmable logic controller includes two or more network controllers including the network controller and being equivalent to the network controller, and the memory allocation circuitry generates memory allocation setting information for each of these network controllers.
12. The program creation support device according to claim 4, wherein: the specific region of the first memory and the specific region of the second memory are constituted by a plurality of regions, and the memory allocation circuitry generates the memory allocation setting information such that each of regions constituting the specific region of the first memory is not redundantly allocated to the plurality of regions constituting the specific region of the second memory.
13. The program creation support device according to claim 4, wherein the memory allocation circuitry selects the specific region of the first memory from a range designated in advance by a user among regions of the first memory, and associates the specific region of the first memory with the specific region of the second memory.
14. The program creation support device according to claim 4, wherein the memory allocation circuitry selects the specific region of the first memory from a range designated in advance by a manufacturer of the programmable logic controller among regions of the first memory, and associates the specific region of the first memory with the specific region of the second memory.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
DESCRIPTION OF EMBODIMENTS
[0024] Hereinafter, a program creation support device, a program creation support method, and a program according to embodiments of the present invention will be described in detail with reference to the drawings. The present invention is not necessarily limited by these embodiments.
[0025] First, a PLC using a program created by a program creation support device according to the present invention will be described with reference to
[0026] A PLC 1000 illustrated in
[0027] The CPU unit 1100 stores a CPU program 1101 that is a sequence program described in a ladder language or the like, and operates in accordance with program codes described in the CPU program 1101 to realize a control operation of the PLC 1000 as a whole. Furthermore, the CPU unit 1100 includes a CPU parameter 1102 for setting an operation of a CPU (not illustrated), and a CPU-side memory 1103 in which a result of an arithmetic operation performed in accordance with the CPU program 1101, and the like are stored. The CPU parameter 1102 includes memory allocation setting information 1121 that is information used in the refresh function, and network configuration setting information 1122 that indicates devices on the communication network managed by the network unit 1200 attached on the base unit 1300 and a region of the network-side memory 1201 that can be referred to by the CPU unit 1100. The memory allocation setting information 1121 indicates to which region of a memory (network-side memory 1201, described later) in the network unit 1200 each of regions where data is updated by the refresh function, among the regions of the CPU-side memory 1103 is allocated. The CPU-side memory 1103 is a first memory of the PLC 1000.
[0028] The network unit 1200 serves as a master station and includes the network-side memory 1201. Information acquired from a device such as a sensor in the communication network by a remote station that is the other network unit described above is aggregated in the network-side memory 1201. The network-side memory 1201 is a second memory of the PLC 1000.
[0029] Hereinafter, embodiments of a program creation support device according to the present invention will be described on the assumption that the CPU program 1101 to be executed by the CPU unit 1100 of the PLC 1000 illustrated in
First Embodiment
[0030]
[0031] The program creation support device 1 receives an operation from a worker who performs programming, and creates the CPU parameter 11 and the CPU program 12 in accordance with the content of the operation. The program creation support device 1 automatically creates memory allocation setting information 111 of the CPU parameter 11. The CPU program 12 illustrated in
[0032] In the following description, it is assumed that the program creation support device 1 stores the CPU program 12 that has been completely created. It is also assumed that the CPU program 12 includes an instruction to access the network-side memory 1201.
[0033] The CPU parameter 11 corresponds to the CPU parameter 1102 stored in the CPU unit 1100 of the PLC 1000 illustrated in
[0034] The change processing unit 20 includes a program extraction unit 21, a memory allocation unit 22, and a program replacement unit 23.
[0035] The program extraction unit 21 analyzes the CPU program 12 and extracts a part where a content representing access to the network-side memory 1201 is described, from the CPU program 12.
[0036] The memory allocation unit 22 updates the memory allocation setting information 111 on the basis of the content of the description in the part extracted by the program extraction unit 21. The update operation of the memory allocation setting information 111 also includes a process of newly creating the memory allocation setting information 111 when the memory allocation setting information 111 to be updated does not exist.
[0037] The program replacement unit 23 replaces the CPU program 12 on the basis of the memory allocation setting information 111 updated by the memory allocation unit 22. Specifically, the program replacement unit 23 rewrites a description that is included in the CPU program 12 and indicates access to the network-side memory 1201, as a description indicating access to the CPU-side memory 1103. For example, a case is assumed where the memory allocation setting information 111 includes information indicating that a region of address Al of the CPU-side memory 1103 is associated with a region of address B1 of the network-side memory 1201. In that case, the program replacement unit 23 rewrites a description that is included in the CPU program 12 and indicates access to the region of address B1 of the network-side memory 1201, as a description indicating access to the region of address A1 of the CPU-side memory 1103.
[0038] Here, hardware for implementing the program creation support device 1 having the configuration illustrated in
[0039] The storage unit 10 of the program creation support device 1 is realized by the memory 92. The change processing unit 20 of the program creation support device 1 is realized by the processor 91 and the memory 92. That is, the program extraction unit 21, the memory allocation unit 22, and the program replacement unit 23 of the change processing unit 20 are implemented by the memory 92 storing therein programs for realizing the functions of these units and the processor 91 reading the programs from the memory 92 and executing the programs.
[0040] The programs for realizing the units of the change processing unit 20 may be provided to a user in a state of being stored in the memory 92 in advance, or may be provided to the user in a state of being written in a computer-readable recording medium such as a CD-ROM (compact disc ROM) or a DVD-ROM (digital versatile disc ROM) to be installed in the memory 92 by the user. Furthermore, the programs may be provided to the user via a communication line such as the internet.
[0041]
[0042] When starting the operation, the change processing unit 20 extracts a part where access to the network-side memory 1201 is described from the CPU program 12 (step S11). Specifically, the program extraction unit 21 reads the CPU program 12 from the storage unit 10 and analyzes the CPU program 12, and extracts a description indicating access to the network-side memory 1201. For example, it is assumed that a program block 121 illustrated in
[0043] Next, the change processing unit 20 allocates the CPU-side memory 1103 to the network-side memory 1201 corresponding to the part extracted in step S11 (step S12). Specifically, the memory allocation unit 22 allocates regions of the CPU-side memory 1103 to respective regions of the network-side memory 1201 indicated by descriptions extracted by the program extraction unit 21. Hereinafter, this process is referred to as a “memory allocation process”. In the memory allocation process, the memory allocation unit 22 allocates a region of the CPU-side memory 1103 while memorizing information about which region of the CPU-side memory 1103 has been allocated to the network-side memory 1201 so as not to redundantly allocate the same region of the CPU-side memory 1103 to different regions of the network-side memory 1201. It is assumed that a region (range) of the CPU-side memory 1103 that can be allocated to the network-side memory 1201 is designated in advance by the user or designated in advance by a manufacturer. In step S12, the memory allocation unit 22 selects a region that has not been subjected to allocation yet, from the designated range of the CPU-side memory 1103 and performs allocation of the selected one.
[0044] Next, the change processing unit 20 updates the memory allocation setting information 111 (step S13). Specifically, the memory allocation unit 22 reflects a result of the memory allocation process of step S12 in the memory allocation setting information 111. Here, in a case where a plurality of communication networks are constructed for one CPU unit 1100, there are pieces of the memory allocation setting information 111 the number of which is as many as the number of networks to be constructed. Therefore, the memory allocation unit 22 updates the memory allocation setting information 111 of a communication network corresponding to the description indicating access to the network-side memory 1201. In a case where the memory allocation setting information 111 of the communication network corresponding to the description indicating access to the network-side memory 1201 does not exist in the storage unit 10, the memory allocation unit 22 newly creates the memory allocation setting information 111. The memory allocation setting information 111 can be, for example, information having a formation illustrated in
[0045] Next, the change processing unit 20 replaces the description indicating access to the network-side memory 1201 in the CPU program 12 with a description indicating access to the CPU-side memory 1103 (step S14). Specifically, the program replacement unit 23 changes the description indicating access to the network-side memory 1201 in the CPU program 12 to the description indicating access to a region of the CPU-side memory 1103 associated with the region indicated by the above description on the basis of the memory allocation setting information 111 updated by the memory allocation unit 22. When the program replacement unit 23 performs a replacement process on the basis of the memory allocation setting information 111-1 illustrated in
[0046] As described above, the program creation support device 1 according to the present embodiment extracts a description indicating access to the network-side memory 1201 from the CPU program 12, allocates an unused region of the CPU-side memory 1103 to a region indicated by the extracted description to generate or update the memory allocation setting information 111 indicating to which region of the network-side memory 1201 each of regions where data is updated by the refresh function is allocated. Furthermore, the program creation support device 1 replaces the description indicating access to the network-side memory 1201 in the CPU program 12 with the description indicating access to the CPU-side memory 1103 on the basis of the memory allocation setting information 111. As a result, the user who is the worker who creates the CPU program 12 does not need to perform the work of creating and updating the memory allocation setting information 111, and thus her or his work load of creating the program is reduced. In addition, the user no longer needs to perform programming with the content of the memory allocation setting information 111 in mind.
Second Embodiment
[0047]
[0048] The change processing unit 30 of the program creation support device 1a includes a network configuration extraction unit 31, a memory allocation unit 32, a program extraction unit 33, and a program replacement unit 34. The program extraction unit 33 and the program replacement unit 34 perform processes similar to those performed by the program extraction unit 21 and the program replacement unit 23 of the program creation support device 1 according to the first embodiment, respectively. Similarly to the program creation support device 1 according to the first embodiment, the program creation support device 1a can be implemented by the hardware illustrated in
[0049] The network configuration extraction unit 31 is an information acquisition unit. The network configuration extraction unit 31 extracts information on a designated region of the network-side memory 1201 that can be referred to by the CPU unit 1100 from the network configuration setting information 112. The said designated region is a region in which a duplicate of stored data can be transferred to the network-side memory 1201 by the refresh function. The information on the designated region of the network-side memory 1201 that can be referred to by the CPU unit 1100 is set as information having a configuration that indicates which region of the network-side memory 1201 can be used as a storage region with which device name.
[0050] The memory allocation unit 32 updates the memory allocation setting information 111 similarly to the memory allocation unit 22 of the program creation support device 1 according to the first embodiment, but the content of a process to be executed in the update operation is partially different therebetween. The memory allocation unit 32 updates the memory allocation setting information 111 on the basis of the information extracted by the network configuration extraction unit 31.
[0051]
[0052] When starting the operation, the change processing unit 30 extracts information on a region of the network-side memory 1201 that can be referred to by the CPU unit 1100 from the network configuration setting information 112 (step S21). The process of step S21 is performed by the network configuration extraction unit 31. The region of the network-side memory 1201 that can be referred to by the CPU unit 1100 corresponds to the above-described designated region. The region of the network-side memory 1201 that can be referred to by the CPU unit 1100 is a region ensured as a region for storing data such as a measurement value required by the CPU unit 1100 when the network unit 1200 acquires the data. The region of the network-side memory 1201 that can be referred to by the CPU unit 1100 is set by the user before starting programming of the CPU program 12, or during the programming.
[0053] Next, the change processing unit 30 allocates the CPU-side memory 1103 to the network-side memory 1201 corresponding to the information extracted in step S21 (step S22). Specifically, the memory allocation unit 32 performs a memory allocation process of allocating a region of the CPU-side memory 1103 to a region of the network-side memory 1201 indicated by the information extracted by the network configuration extraction unit 31. It is assumed that the region of the CPU-side memory 1103 that can be allocated to the network-side memory 1201 is designated in advance by the user or designated in advance by a manufacturer. In step S22, the memory allocation unit 32 selects an unallocated region from the designated range of the CPU-side memory 1103 and performs allocation accordingly.
[0054] Next, the change processing unit 30 updates the memory allocation setting information 111 (step S23). Specifically, the memory allocation unit 32 reflects a result of the memory allocation process of step S22 in the memory allocation setting information 111.
[0055] Next, the change processing unit 30 extracts a part where access to the network-side memory 1201 is described from the CPU program 12 (step S24). The process of step S24 is similar to the process of step S11 described in the first embodiment, which is performed by the program extraction unit 33.
[0056] Next, the change processing unit 30 replaces a description indicating access to the network-side memory 1201 in the CPU program 12 with a description indicating access to the CPU-side memory 1103 (step S25). The process of step S25 is similar to the process of step S14 described in the first embodiment, which is performed by the program replacement unit 34. When the program replacement unit 34 performs a replacement process on the basis of the memory allocation setting information 111-2 illustrated in
[0057] As described above, the program creation support device 1a according to the present embodiment generates or updates the memory allocation setting information 111 on the basis of the information on a region of the network-side memory 1201 that can be referred to by the CPU unit 1100, the information being included in the network configuration setting information 112 of the CPU parameter 11. Furthermore, the program creation support device 1a replaces the description indicating access to the network-side memory 1201 in the CPU program 12 with the description indicating access to the CPU-side memory 1103 on the basis of the memory allocation setting information 111. The program creation support device 1a according to the present embodiment can achieve advantageous effects similar to those of the program creation support device 1 according to the first embodiment.
[0058] The configurations described in the embodiments above are merely examples of the content of the present invention, and can each be combined with other publicly known techniques and partially omitted and/or modified without departing from the scope of the present invention.
[0059] The description has been given in each embodiment based on the assumption that the PLC 1000 has the configuration illustrated in
REFERENCE SIGNS LIST
[0060] 1, 1a program creation support device; 10 storage unit; 11, 1102 CPU parameter; 12, 1101 CPU program; 20, 30 change processing unit; 21, 33 program extraction unit; 22, 32 memory allocation unit; 23, 34 program replacement unit; 31 network configuration extraction unit; 111, 111-1, 111-2, 1121 memory allocation setting information; 112, 1122 network configuration setting information; 121, 122, 123 program block; 1000 PLC; 1100 CPU unit; 1103 CPU-side memory; 1200 network unit; 1201 network-side memory; 1300 base unit.