Program-aiding program product, program-aiding apparatus, and program-aiding method

By automating the calculation, decision-making, and change unit processes, the problem of manually adjusting memory allocation capacity in PLC projects has been solved, achieving automated adjustment and efficient selection of PLC models, thus improving programming assistance efficiency.

CN119487466BActive Publication Date: 2026-01-20MITSUBISHI ELECTRIC CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202280097743.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-08
Publication Date
2026-01-20
Estimated Expiration
2042-12-08

AI Technical Summary

Technical Problem

In PLC project programming, users need to manually adjust the memory allocation capacity to cope with situations where the usage capacity of each element exceeds the pre-allocated capacity, lacking an automated solution.

Method used

The calculation unit calculates the memory usage capacity, the decision unit determines the allocated capacity, and the change unit automatically adjusts the memory allocation. The display unit displays the adjustment results, thus realizing the automatic change of memory allocation capacity for each type of PLC project element.

Benefits of technology

It enables automatic adjustment of memory allocation capacity in PLC projects, reducing manual operation by users, improving efficiency, and allowing selection of suitable PLC models based on the usage capacity, saving the workload of model selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119487466B_ABST
    Figure CN119487466B_ABST
Patent Text Reader

Abstract

A programming support program causes a computer to function as: a calculation section (101) that acquires information indicating an address space from a database, which stores information indicating an address space to which a range of memory is previously allocated for each kind of element included in a project executed in a PLC, allocates the element included in the project to the address space, and thereby calculates a used capacity of memory used by the project for each kind of element; a decision section (102) that decides an allocation capacity of memory allocated to each kind of element based on the used capacity and an allocation capacity of memory calculated from the previously allocated range; a change section (103) that changes the range previously allocated to each kind of element based on the decided allocation capacity of each kind of element; and a display section (104) that displays the used capacity calculated by the calculation section (101) and the allocation capacity decided by the decision section (102) on a screen for each kind of element.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a programming assistance program, a programming assistance device, and a programming assistance method. BACKGROUND

[0002] In programming of a project of a PLC (Programmable Logic Controller), a technique of prompting a user of a used capacity of a memory of a PLC used by a project is known. For example, in Patent Literature 1, a technique of inquiring a PLC, acquiring a consumed size of a project area in which project data is stored, a consumed size of a user area in which user data such as a log file and a user manual of the PLC is stored, and displaying these consumed sizes on a screen is disclosed.

[0003] Patent Literature 1: Japanese Patent Application Publication No. 2016-081300 SUMMARY

[0004] In the above-described technique, in a case where it is necessary to change an allocation capacity of a memory with respect to a project, for example, in a case where a used capacity of a memory used by a certain element included in the project exceeds an allocation capacity allocated to each category of the element, the user needs to refer to the displayed used capacity to change the allocation capacity by manual work.

[0005] The present application has been made in view of the above-described circumstances, and has an object to provide a programming assistance program, a programming assistance device, and a programming assistance method capable of automatically changing an allocation capacity of a memory allocated to each category of an element included in a project of a PLC.

[0006] To achieve the above-described object, a programming assistance program according to the present application causes a computer to function as:

[0007] a calculation unit that acquires information indicating an address space from a database, allocates an element included in a project to the address space indicated by the acquired information, and thereby calculates a used capacity of a memory used by the project with respect to each category of the element, wherein the database stores information indicating that a range of the address space of the memory is previously allocated to each category of an element included in the project executed in a programmable logic controller;

[0008] a decision unit that decides an allocation capacity of the memory allocated to each category of an element included in the project, based on the used capacity calculated with respect to each category of the element and an allocation capacity of the memory calculated from the range previously allocated to each category of the element;

[0009] a changing unit that changes a range that is preliminarily allocated to each kind of the element related to the information of the address space stored in the database, based on the allocation capacity of each kind of the element decided by the deciding unit; and

[0010] a display unit that displays the usage capacity calculated by the calculating unit and the allocation capacity decided by the deciding unit on a screen for each kind of the element.

[0011] Effects of the Invention

[0012] According to the present application, it is possible to provide a programming support program, a programming support device, and a programming support method that can automatically change the allocation capacity of the memory allocated to each kind of the element included in the project of the PLC. BRIEF DESCRIPTION OF DRAWINGS

[0013] Figure 1 is a diagram showing a functional structure of the programming support device related to Embodiment 1.

[0014] Figure 2 is a block diagram showing a hardware structure of the programming support device related to Embodiment 1.

[0015] Figure 3 is a diagram showing a display example of the usage capacity of the memory used by the tag related to Embodiment 1.

[0016] Figure 4 is a diagram showing a display example of the usage capacity of the memory used by the tag related to Embodiment 1.

[0017] Figure 5 is a diagram showing a display example of the usage capacity of the memory used by the tag related to Embodiment 1.

[0018] Figure 6 is a diagram showing a display example of the usage capacity of the memory used by the device related to Embodiment 1.

[0019] Figure 7 is a diagram showing a display example of the usage capacity of the memory used by the device related to Embodiment 1.

[0020] Figure 8 is a diagram showing a display example of the model selection result related to Embodiment 1.

[0021] Figure 9 is a flowchart showing the display processing related to Embodiment 1.

[0022] Figure 10 is a flowchart showing the adjustment processing related to Embodiment 1.

[0023] Figure 11 is a flowchart showing the increase processing involved in Embodiment 1.

[0024] Figure 12 is a flowchart showing the reduction processing involved in Embodiment 1.

[0025] Figure 13 is a flowchart showing the selection processing involved in Embodiment 1.

[0026] Figure 14 is a diagram showing the functional structure of the programming assistance device involved in Embodiment 2.

[0027] Figure 15 is a diagram showing the functional structure of the learning device involved in Embodiment 2.

[0028] Figure 16 is a flowchart showing the learning processing of the learning device involved in Embodiment 2.

[0029] Figure 17 is a diagram showing the functional structure of the inference device involved in Embodiment 2.

[0030] Figure 18 is a flowchart showing the inference processing of the inference device involved in Embodiment 2. DETAILED DESCRIPTION

[0031] (Embodiment 1)

[0032] The programming assistance device 100 involved in Embodiment 1 is a device that assists in the programming of a project executed by a PLC. For example, the programming assistance device 100 is a device that implements a programming assistance tool. The programming assistance device 100 is communicably connected to a project database 200 as shown in Figure 1

[0033] The project database 200 stores information of a project executed by a PLC. The information of the project is a data group of information related to a project created by the programming assistance device 100. The information of the project includes address information 210. The address information 210 is information indicating an address space of a memory of a PLC, and a range is assigned in advance for each kind of element included in the project. The kinds of elements included in the project are, for example, a program, an FB (Function Block), a structure, a tag, and a device. That is, a range in the address space is determined in advance for each of the program, the FB (Function Block), the structure, the tag, and the device. Therefore, an allocation capacity of the assigned memory is determined in advance for each kind of element. Further, the project database 200 is one example of a database.

[0034] ​If the user creates a project, the programming assistance device 100 executes an allocation process of allocating the elements included in the project to the address space at an arbitrary timing. If the allocation process is executed, the allocation information in which the addresses of the address space are associated with the elements included in the project is stored as the address information 210. Depending on the project created by the user, the usage capacity of each kind of the elements included in the project can exceed the allocation capacity allocated in advance to each kind of the elements. The programming assistance device 100 automatically adjusts the allocation capacity in such a case.

[0035] Figure 1 The programming assistance device 100 has a hardware structure as shown in Fig. 1. Figure 2

[0036] The programming assistance device 100 has a processor 11 that executes various processes, a main storage section 12 that is used as a work area of the processor 11, an auxiliary storage section 13 that stores various data used for the processes of the processor 11, a communication section 14 that is used for communication with an external device, an input section 15 that acquires information input thereto, and an output section 16 that presents various information. The main storage section 12, the auxiliary storage section 13, the communication section 14, the input section 15, and the output section 16 are connected to the processor 11 via a bus 17.

[0037] The processor 11 includes a CPU (Central Processing Unit). The processor 11 realizes various functions of the programming assistance device 100 by executing a program stored in the auxiliary storage section 13.

[0038] The main storage section 12 includes a RAM (Random Access Memory). A program is loaded from the auxiliary storage section 13 to the main storage section 12. Also, the main storage section 12 is used as a work area of the processor 11.

[0039] The auxiliary storage section 13 includes a nonvolatile memory typified by an EEPROM (Electrically Erasable Programmable Read-Only Memory). The auxiliary storage section 13 stores various data used for the processes of the processor 11 in addition to a program. The auxiliary storage section 13 supplies data used by the processor 11 to the processor 11 and stores data supplied from the processor 11 in accordance with an instruction from the processor 11.

[0040] The communication section 14 includes a network interface circuit that is used for communication with an external device. The communication section 14 receives a signal from an external device and outputs data indicated by the signal to the processor 11. Also, the communication section 14 transmits a signal indicating data output from the processor 11 to an external device.​

[0041] The input section 15 includes input keys, a pointing device, and the like. The input section 15 acquires information input by a user of the programming assistance device 100, and notifies the acquired information to the processor 11.

[0042] The output section 16 includes an LCD (Liquid Crystal Display), a speaker, and the like. The output section 16 can also be configured as a touch screen formed integrally with the pointing device that configures the input section 15. The output section 16 prompts various information to the user in accordance with the instruction of the processor 11.

[0043] Next, the functions of the programming assistance device 100 will be described. Figure 1 The programming assistance device 100 has, in terms of functions, a calculation section 101 that calculates the usage capacity of the memory used by a project, a decision section 102 that decides the allocation capacity of the memory, a change section 103 that changes the allocation capacity allocated in advance, a display section 104 that displays the usage capacity and the allocation capacity on a screen, and a selection section 105 that selects the model of the PLC suitable for executing the project.

[0044] Figure 1 The calculation section 101 acquires the information of the address space from the project database 200, allocates the elements included in the project to the address space related to the acquired information, thereby calculating the usage capacity of the memory used by the project for each kind of the elements, wherein the information of the address space of the memory of the range allocated in advance for each kind of the elements included in the project executed in the PLC is stored in the project database 200. The calculation section 101 is realized by the processor 11 and the communication section 14. Further, the calculation section 101 is one example of a calculation unit.

[0045] For example, if the user creates the project X, the calculation section 101 acquires the address information 210 from the project database 200, and allocates the elements included in the project X to the address space shown in the address information 210. Further, the calculation section 101 calculates the usage capacity of the memory for each kind of the elements based on the result of the allocation. For example, the calculation section 101 calculates "110 Kbytes", "50 Kbytes", "40 Kbytes", "39 Kbytes", and "20 Kbytes" as the usage capacities of the program, the FB, the structure, the tag, and the device, respectively.

[0046] The display section 104 displays the usage capacity calculated by the calculation section 101 on the screen for each kind of the elements. In addition, the display section 104 displays the usage capacity used by the elements included in the project. The display section 104 is realized by the processor 11 and the output section 16. Further, the display section 104 is one example of a display unit.

[0047] For example, display unit 104 will Figure 3 The window 300 shown is displayed on the screen. Window 300 includes: column 301, which specifies the type of element; button 302, which adjusts the allocated capacity for the type of element; button 303, which selects and displays the PLC model suitable for the project created by the user; column 304, which specifies the increase / decrease rate of the allocated capacity's idle capacity; value of used capacity 305; value of allocated capacity 306; bar chart 307, which shows the ratio of used capacity to allocated capacity; and table 308, which shows the used capacity of each element. If the drop-down button of column 301 is selected, the types of elements included in the project are displayed as options. Additionally, if the drop-down button of column 304 is selected, values ​​representing the increase / decrease rates, such as "Increase Rate: 10%", "Increase Rate: 20%", "Increase Rate: 30%", ..., "Reduction Rate: 10%", "Reduction Rate: 20%", "Reduction Rate: 30%", ..., are displayed as options.

[0048] Figure 3 Window 300 is the window displayed on the screen when the element type in column 301 is specified as "Label". Additionally, Figure 3 Column 304 indicates that no increase / decrease rate is specified. Additionally, the value 305 for the used capacity of tags in item X is "39K words," and the value 306 for the allocated capacity of tags in memory is "28K words." Bar chart 307 shows that the used capacity exceeds the allocated capacity. Furthermore, table 308 shows the memory usage capacity of each tag included in item X. Figure 3 In window 300, if button 302 is selected, the allocation capacity adjustment process performed by decision unit 102 is executed.

[0049] The decision unit 102 determines the memory allocation capacity to each type of element included in the project based on the usage capacity calculated for each type of element and the memory allocation capacity calculated according to the range pre-allocated to each type of element. The decision unit 102 is implemented by the processor 11. Furthermore, the decision unit 102 is an example of a decision unit.

[0050] For example, the decision unit 102 determines whether there are any types of elements whose usage capacity exceeds the pre-allocated allocation capacity. If it determines that there are such types, it then determines whether there are other types of elements whose usage capacity is less than the pre-allocated allocation capacity, i.e., other types of elements with available capacity within the allocation capacity. Then, if there are no other types of elements with available capacity, the decision unit 102 ends the adjustment process; if there are other types of elements with available capacity, it reduces the allocation capacity of those other types, increasing the allocation capacity of the excess type by the amount of reduction. If the decision unit 102 eliminates the situation where usage capacity exceeds allocation capacity for all types of elements, it ends the adjustment process.

[0051] For example, if the decision unit 102 sets the pre-allocated capacity of the tag and the device to "28K words" and "35K words" respectively, then the pre-allocated capacity of the tag "28K words" is "11K words" less than the used capacity "39K words", and the pre-allocated capacity of the device "35K words" is "15K words" more than the used capacity "20K words". Therefore, the decision unit 102 determines the allocated capacity of the tag to be "39K words" after increasing "28K words" by "11K words", and determines the allocated capacity of the device to be "24K words" after decreasing "35K words" by "11K words".

[0052] In addition, such as Figure 4 As shown, when an increase rate is specified in column 304, the following processing is performed. First, if an increase rate is specified, the determination unit 102 sets a first specified value. The first specified value is the sum of the proportion of free capacity in the allocated capacity and the specified increase rate. For example, in Figure 4 In the case of the indicated increase rate, the first specified value is "41%" which is the sum of the proportion of free capacity in the allocated capacity "21%" and the increase rate "20%". The decision unit 102 determines whether the free capacity of the element type "label" specified in column 301 is less than the first specified value. If it is less than the first specified value, it determines whether there are other element types with free capacity. Furthermore, if there are no other element types with free capacity, the decision unit 102 ends the increase process; if there are other element types with free capacity, it reduces the allocated capacity of that element type and increases the allocated capacity of the element type with the specified increase rate by the amount of the reduction. The decision unit 102 ends the increase process if the free capacity of the allocated capacity of the element type with the specified increase rate is greater than or equal to the first specified value.

[0053] In addition, when the reduction rate is specified in the column 304, the following processing is performed. First, if the reduction rate is specified, the determination section 102 sets a second specified value. The second specified value is the difference between the value of the proportion of the free capacity in the allocation capacity and the value of the specified reduction rate. For example, with respect to the kind of element "tag", in the case where the reduction rate "20%" is specified, the second specified value is "1%" which is the difference between the proportion "21%" of the free capacity in the allocation capacity and the reduction rate "20%". In the case where the second specified value is less than "0", it is indicated that the allocation capacity does not satisfy the usage capacity and the free capacity cannot be reduced. The determination section 102 judges whether or not the second specified value is greater than or equal to "0" which indicates whether or not the allocation capacity can be reduced by the amount of the specified reduction rate. The determination section 102 reduces the allocation capacity of the specified kind of element in such a manner that the free capacity becomes "1%" in the case where the specified value is greater than or equal to "0", and ends the reduction processing in the case where the specified value is less than "0". Furthermore, the determination section 102 increases the allocation capacity of another kind of element, for example, in which the free capacity is smallest by the amount of reduction if the allocation capacity of the kind of element is reduced by the amount of the specified reduction rate. In addition, the determination section 102 can increase the allocation capacity of another kind of element specified by the user by the amount of reduction.

[0054] The change section 103 changes the range allocated in advance to each kind of element related to the information of the address space stored in the project database 200, on the basis of the allocation capacity of each kind of element decided by the determination section 102. The change section 103 is realized by the processor 11 and the communication section 14. In addition, the change section 103 is one example of a change unit.

[0055] For example, if the button 302 is selected in the Figure 3 , the adjustment processing is performed by the determination section 102, and the change section 103 changes the range of the address space of "tag" and "device" stored in the project database 200 on the basis of the allocation capacity "39K words" of "tag" and the allocation capacity "24K words" of "device" decided by the determination section 102. Thereby, the change section 103 changes the allocation capacity allocated in advance to each kind of element to the allocation capacity decided by the determination section 102.

[0056] The display section 104 displays the allocation capacity decided by the determination section 102 on the screen.

[0057] For example, the display section 104 displays the value 306 of the allocation capacity of "tag" decided by the determination section 102 as shown in Figure 5 , and updates the display of the bar chart 307 on the basis of the allocation capacity decided by the determination section 102.

[0058] In addition, the display section 104 displays the attached information for explaining the element.

[0059] The attached information is information for explaining the element, and is information given by a user who creates the project or automatically given. For example, the attached information of the tag is a note for explaining the tag, the attached information of the device is a note for explaining the device number and the device, the attached information of the FB is a note for explaining the FB instance, the attached information of the structure is a note for explaining the data in the structure, and the attached information of the program is a program note for explaining the program.

[0060] In Figure 6 A window 300 displayed on the screen by the display section 104 in the case where the kind of the element in the column 301 is designated as "device" is shown. As with the window 300 of Figure 3 The window 300 of Figure 6 The column 301, 304 and the button 302, 303 are displayed in the window 300 of

[0061] For example, in the case where a specific part of the bar graph 311 is designated by the pointer 314 in the window 300 of Figure 6 If the user performs a display zoom-in operation using a mouse, a keyboard, a touch panel, or the like, the display section 104 displays the window 300 of Figure 7 In the window 300 of Figure 7 The values of the lower limit value 312 and the upper limit value 313 are changed in the window 300 of

[0062] Figure 1 The selection section 105 selects the model of the PLC suitable for executing the project for which the used capacity has been calculated, on the basis of the used capacity calculated by the calculation section 101 and the model information 110 which includes the model of the PLC and the memory capacity of the PLC in association. The selection section 105 is implemented by the processor 11. Furthermore, the selection section 105 is one example of a selection unit.

[0063] The model information 110 is information in which the model number of the PLC is associated with the memory capacity. Information indicating whether or not expansion of SRAM (Static Random Access Memory) is possible is also included in the model information 110. The model information 110 is stored in the auxiliary storage section 13 of the programming assistance device 100.

[0064] For example, if the button 303 is selected in the window 300 of Figure 3 The selection section 105 compares the used capacity of the memory of the project X calculated by the calculation section 101 with the model information 110, and selects the model number of the PLC suitable for executing the project X. For example, the selection section 105 judges that the PLC having a larger memory capacity than the used capacity of the memory of the project and being less expensive is suitable for executing the project X. For example, the PLC having a smaller memory capacity is less expensive, and the PLC in which expansion of SRAM is not possible is less expensive than the PLC in which expansion of SRAM is possible. In the case where there are a plurality of PLCs having a larger memory capacity than the used capacity of the memory of the project, the selection section 105 selects the PLC having a smaller memory capacity and in which expansion of SRAM is not possible.

[0065] Then, the display section 104 highlights the model information including the model number selected by the selection section 105.

[0066] For example, the display section 104 displays the table 405 including the used capacity of the memory 401 used in the entire project, the model number of the PLC 402, the memory capacity of the PLC 403, and the information 404 indicating whether or not expansion of SRAM is possible, as shown in the window 400. Figure 8

[0067] Next, the display processing performed by the programming assistance device 100 according to the present embodiment will be described using the flowchart of Figure 9 Figure 9 The display processing according to the present embodiment is processing performed when an operation of displaying the used capacity of the memory of the project is received from the user.

[0068] ​​The calculating section 101 allocates the elements included in the project to the address space related to the information acquired from the project database 200, which stores information on the address space of the range of memory allocated in advance to each kind of element included in the project executed in the PLC, and calculates the usage capacity of the memory used by the project for each kind of element (step S101). Then, the display section 104 displays the usage capacity calculated by the calculating section 101 for each kind of element on the screen (step S102).

[0069] For example, the calculating section 101 acquires the address information 210 from the project database 200, allocates the elements included in the project X to the address space shown in the address information 210, and calculates the usage capacity of the memory for each kind of element and the elements based on the result of the allocation. Then, the display section 104 displays the usage capacity "39K" words calculated for the kind of element "tag" on the screen as shown in Figure 3

[0070] The deciding section 102 judges whether or not the adjustment instruction has been received (step S103). If the deciding section 102 judges that the adjustment instruction has been received (step S103; YES), it judges whether or not the increase / decrease rate has been specified (step S104). On the other hand, if the deciding section 102 judges that the adjustment instruction has not been received (step S103; NO), it remains in standby.

[0071] For example, if the deciding section 102 detects the selection of the button 302 in the window 300 of Figure 3 , it judges that the adjustment instruction has been received and judges whether or not the increase / decrease rate has been specified in the field 304. On the other hand, if the deciding section 102 does not detect the selection of the button 302 in the window 300 of Figure 3 , it judges that the adjustment instruction has not been received and remains in standby.

[0072] If the deciding section 102 judges that the increase / decrease rate has not been specified (step S104; NO), it proceeds to the processing of step S105. On the other hand, if the deciding section 102 judges that the increase / decrease rate has been specified (step S104; YES), it judges whether or not the increase rate has been specified (step S106). If the deciding section 102 judges that the increase rate has been specified (step S106; YES), it proceeds to step S107, and if it judges that the increase rate has not been specified, i.e., the decrease rate has been specified (step S106; NO), it proceeds to step S108.

[0073] For example, as shown in Figure 3 ​as shown in the window 300, when the increase rate is not specified in the column 304, the decision section 102 judges that the increase rate is not specified, and executes the adjustment process of step S105. On the other hand, as shown in the window 300, when the increase rate is specified in the column 304, the decision section 102 judges that the increase rate is specified, and executes the increase process of step S107, and when the reduction rate is specified in the column 304, the decision section 102 judges that the reduction rate is specified, and executes the reduction process of step S108. Figure 4

[0074] The adjustment process executed by the program assistance device 100 according to the present embodiment will be described using a flowchart. Figure 10

[0075] The decision section 102 acquires the usage capacity calculated for each kind of element and the allocation capacity of the memory calculated from the range preliminarily allocated to each kind of element (step S201).

[0076] For example, the decision section 102 acquires the usage capacity and the allocation capacity of the program, the FB, the structure, the tag, and the device calculated by the calculation section 101.

[0077] The decision section 102 judges whether there is a kind of element whose usage capacity exceeds the preliminarily allocated allocation capacity (step S202). If the decision section 102 judges that there is a kind of element that exceeds the allocation capacity (step S202; YES), the decision section 102 judges whether there is a kind of element whose allocation capacity has free capacity (step S203). On the other hand, if the decision section 102 judges that there is no kind of element that exceeds the allocation capacity (step S202; NO), the decision section 102 ends the adjustment process. If the decision section 102 judges that there is a kind of element whose allocation capacity has free capacity (step S203; YES), the decision section 102 reduces the allocation capacity of the kind of element that has free capacity (step S204), and increases the allocation capacity of the kind of element that exceeds the allocation capacity by the amount of reduction (step S205). On the other hand, if the decision section 102 judges that there is no kind of element whose allocation capacity has free capacity (step S203; NO), the decision section 102 ends the adjustment process.

[0078] ​​For example, if the tag usage capacity of "39K words" exceeds the pre-allocated capacity of "28K words", the decision unit 102 determines that there is a type of element that exceeds the allocated capacity and determines whether there are other types of elements with available allocated capacity. Furthermore, if the device's allocated capacity is "35K words" and it has "15K words" of available capacity, the decision unit 102 determines that there is a type of element with available allocated capacity, and reduces the device's allocated capacity by "11K words" to a deficiency of "11K words", setting the device's allocated capacity to "24K words" and the tag's allocated capacity to "39K words" (increased by "11K words"). If the adjustment process is complete, it returns to the previous state. Figure 9 Step S109.

[0079] Next, use Figure 11 The flowchart below describes the addition process performed by the programming assistance device 100 according to this embodiment. Furthermore, the processing of step S301 is related to... Figure 10 The steps are the same as S201, so the explanation will begin from step S302.

[0080] The decision unit 102 determines whether the available capacity of the element type with a specified increase rate is less than a first specified value (step S302). If the decision unit 102 determines that the available capacity of the element type with a specified increase rate is less than the first specified value (step S302; YES), it determines whether there are other element types with available capacity (step S303). On the other hand, if the decision unit 102 determines that the available capacity of the element type with a specified increase rate is greater than or equal to the first specified value (step S302; NO), it ends the increase process. If the decision unit 102 determines that there are other element types with available capacity (step S303; YES), it reduces the allocation capacity of that element type (step S304) and increases the allocation capacity of the element type with a specified increase rate by the amount of reduction (step S305). Then, it returns to step S302. On the other hand, if the decision unit 102 determines that there are no other element types with available capacity (step S303; NO), it ends the increase process.

[0081] For example, since the current free capacity of the label is "21%", the first specified value "41%" after adding the increase rate "20%" is not satisfied, and thus the determination section 102 determines whether or not there is a kind of element having a free capacity. Further, if the determination section 102 determines that there is a kind of element "device" having a free capacity, the determination section 102 reduces the free capacity of the allocation capacity of the device by the amount of capacity required to increase the free capacity of the label by the increase rate "20%", and increases the allocation capacity of the label by the reduced capacity. Then, the determination section 102 returns to step S302, determines whether or not the increased free capacity of the label satisfies the first specified value, and if it is determined that the first specified value is satisfied, the increase processing is ended. On the other hand, if the determination section 102 determines that the increased free capacity of the label does not satisfy the first specified value, for example, the free capacity of the device does not satisfy the capacity required to increase the free capacity of the label by the increase rate "20%", the determination section 102 determines whether or not there is a kind of element having a free capacity among the kinds of elements other than the device. Further, if there is a kind of element having a free capacity among the kinds of elements other than the device, the determination section 102 reduces the free capacity of the kind of element by the required amount and adds to the allocation capacity of the label. In this way, the processing is repeatedly executed until the free capacity of the label is greater than or equal to the first specified value.

[0082] Next, the reduction processing performed by the programming assistance device 100 according to the present embodiment will be described using the flowchart of Figure 12 Further, the processing of step S401 is the same as step S201 of Figure 10 , and thus the description will be made from step S402.

[0083] The determination section 102 determines whether or not the second specified value of the free capacity of the kind of element to which the reduction rate is specified is greater than or equal to 0 (step S402). If the determination section 102 determines that the second specified value of the free capacity of the kind of element to which the reduction rate is specified is greater than or equal to 0 (step S402; YES), the determination section 102 reduces the allocation capacity of the kind of element to which the reduction rate is specified by the specified reduction rate (step S403). On the other hand, if the determination section 102 determines that the second specified value of the free capacity of the kind of element to which the reduction rate is specified is less than 0 (step S402; NO), the reduction processing is ended.

[0084] For example, in a case where the current free capacity of the label is "21%" and the reduction rate is "20%", the second specified value is "1%", and thus the determination section 102 reduces the allocation capacity of the kind of element "label" so that the free capacity becomes "1%". On the other hand, in a case where the reduction rate is "30%", the second specified value is less than 0, and thus the determination section 102 ends the reduction processing.

[0085] If the adjustment process of step S105, the increase process of step S107, and the reduction process of step S108 end, the change section 103 changes the range of each kind of element to which the range is allocated in advance with respect to the information of the address space stored in the project database 200, on the basis of the allocation capacity of each kind of element decided by the decision section 102 (step S109). Then, the display section 104 displays the decided allocation capacity on the screen (step S110).

[0086] For example, the change section 103 changes the range of the address space of "tag" and "device" stored in the project database 200, on the basis of the allocation capacity "39K words" of "tag" and the allocation capacity "24K words" of "device" decided by the decision section 102. Also, the display section 104 displays the value 306 of the allocation capacity of "tag" decided by the decision section 102 as shown in Figure 5

[0087] Next, the selection process performed by the programming assistance device 100 according to the present embodiment will be described using the flowchart of Figure 13

[0088] The selection section 105 acquires the usage capacity of the project (step S501). Also, the selection section 105 acquires the model information 110 (step S502). Then, the selection section 105 selects the model of the PLC suitable for executing the project (step S503), and the display section 104 displays the model information including the selected model highlighted on the screen (step S504).

[0089] For example, if the button 303 is selected in the window 300 of Figure 3 , the selection section 105 acquires the usage capacity of the memory of the project X calculated by the calculation section 101. Also, the selection section 105 acquires the model information 110 from the auxiliary storage section 13. Then, the selection section 105 compares the usage capacity of the memory of the project X with the model information 110, and selects the model of the PLC suitable for executing the project X. The display section 104 displays the table 405 on the screen as shown in the window 400 of Figure 8

[0090] According to the present embodiment, the usage capacity of the memory is calculated for each kind of element included in the project of the PLC created by the user, and the allocation capacity is automatically changed in a case where the usage capacity calculated for each kind of element exceeds the allocation capacity allocated in advance to each kind of element. Thus, the man-hours related to the creation of the project by the user can be reduced. ​​​

[0091] In addition, according to the present embodiment, it is possible to grasp the usage capacity and the free capacity for each kind of the elements included in the project. Thereby, in the continuation development of the project, it is possible to easily judge what degree of expansion can be achieved.

[0092] In addition, according to the present embodiment, it is possible to grasp the usage capacity of the elements included in the project, and further, it is possible to confirm the attached information given to the elements. Thereby, it is possible to easily make a judgment of addition and deletion of the elements included in the project.

[0093] In addition, according to the present embodiment, it is possible to select the PLC suitable for the project based on the usage capacity of the memory of the project, that is, the capacity of the memory required for the project. Thereby, in the case of expanding the system, by creating the project in advance, it is possible to save the workload of the user to collect the information required for the model selection of the PLC.

[0094] (Embodiment 2)

[0095] The programming assistance device 100 according to Embodiment 2 selects the model information including the model number of the PLC suitable for executing the project, using the inference result based on the learned model.

[0096] The programming assistance device 100 according to Embodiment 2 includes a learning device 500, an inference device 600, and a trained model storage section 700, as shown in FIG. 2. Figure 14

[0097] In the programming assistance device 100 according to Embodiment 2, the selection section 105 regards the PLC of the model number included in the model information inferred by the inference device 600 using the trained model generated by the learning device 500 as the PLC suitable for executing the project.

[0098] Figure 15 is a diagram showing the functional structure of the learning device 500. The learning device 500 has a data acquisition section 501 and a model generation section 502.

[0099] The data acquisition section 501 acquires learning data including the usage capacity information 120 indicating the usage capacity of the project calculated by the calculation section 101 and the model information 110 including the model number selected by the selection section 105. The data acquisition section 501 is realized by the processor 11. In addition, the data acquisition section 501 is one example of the second data acquisition unit.

[0100] ​The usage capacity information 120 is stored in the auxiliary storage 13 in association with information identifying the project in a case where the usage capacity is calculated by the calculation section 101 for the project. In addition, the model information 110 in which the model is selected for the project for which the usage capacity has been calculated is stored in the auxiliary storage 13 in association with information identifying the project for which the usage capacity has been calculated in a case where the selection processing is performed by the selection section 105.

[0101] The data acquisition section 501 acquires the usage capacity information 120 and the model information 110 associated with information identifying the project as learning data from the auxiliary storage 13.

[0102] The model generation section 502 learns the model information including the model to be selected based on the learning data including the model information 110 including the model that has been selected. That is, a trained model that reasons the model information 110 including the model to be selected based on the usage capacity of the project is generated. The model generation section 502 is implemented by the processor 11. Further, the model generation section 502 is one example of a model generation unit.

[0103] The learning algorithm used by the model generation section 502 can use a known algorithm such as supervised learning, unsupervised learning, reinforcement learning, and the like. As one example, a case where reinforcement learning is applied will be described. In reinforcement learning, an agent (action subject) within a certain environment observes a current state (a parameter of the environment) and decides an action to be taken. The environment dynamically changes by the action of the agent, and a reward is given to the agent in correspondence with the change in the environment. The agent repeatedly performs these operations and learns an action policy that obtains the most reward by a series of actions. As representative methods of reinforcement learning, Q-learning and TD-learning are known. For example, in the case of Q-learning, a general update formula of an action value function Q(s, a) is represented by Expression 1.

[0104] [Expression 1]

[0105]

[0106] In Expression 1, s t represents a state of the environment at time t, a t represents an action at time t. By the action a t , the state changes to s t+1 . r t+1Let γ represent the gain achievable through a change in state, γ represent the discount rate, and α represent the learning coefficient. Furthermore, γ is in the range of 0 < γ ≤ 1, and α is in the range of 0 < α ≤ 1. Aircraft type information becomes action a. t Using capacity information to become state s t The state s at time t t The best action under the following circumstances t To learn.

[0107] Regarding the update formula represented by Equation 1, if the action value Q of action a with the highest Q value at time t+1 is greater than the action value Q of action a executed at time t, then the action value Q is increased; conversely, the action value Q is decreased. In other words, the action value function Q(s, a) is updated in a way that makes the action value Q of action a at time t close to the optimal action value at time t+1. Thus, the optimal action value in a certain environment propagates sequentially to the action values ​​in previous environments.

[0108] As described above, when a trained model is generated through reinforcement learning, the model generation unit 502 has a revenue calculation unit 502a and a function update unit 502b.

[0109] The revenue calculation unit 502a calculates revenue based on the model information 110, including the selected model, and the usage capacity information 120. The revenue calculation unit 502a calculates revenue r based on the appropriateness of the model information 110, including the selected model. The appropriateness of the model information 110, including the selected model, is determined, for example, by whether the user determines that the PLC of the model included in the highlighted model information 110 is suitable for executing the project. For example, when displaying… Figure 8 After window 400, the programming aid 100 prompts the user to select a PLC suitable for executing item X from the PLC models listed in table 405, and receives the user's selection. The higher the proportion of selections received from the user for the highlighted model information, the more appropriate the model information 110 is considered to include the selected model. For example, as... Figure 8 As shown in window 400, when the model information of the three PLCs is highlighted, the more model information among the three that the user selects as the PLC model suitable for executing project X, the higher the selection ratio. When the suitability of model information 110 is high, the benefit r is increased (e.g., a benefit of "1" is assigned). Conversely, when the suitability of model information 110 is low, the benefit r is decreased (e.g., a benefit of "-1" is assigned).

[0110] The function updating section 502b updates the function for determining the model information including the model selected by the selection section 105 based on the profit calculated by the profit calculating section 502a, and outputs to the trained model storage section 700. For example, in the case of Q-learning, the action value function Q(s t , a t ) represented by Expression 1 is used as the function for calculating the model information including the model selected by the selection section 105.

[0111] The above learning is repeatedly performed. The trained model storage section 700 stores the action value function Q(s t , a t ) updated by the function updating section 502b, that is, the trained model.

[0112] Next, the processing of the learning by the learning device 500 will be described using Figure 16 , a Figure 16 is a flowchart of the learning processing of the learning device 500.

[0113] The data obtaining section 501 obtains the model information 110 including the selected model and the usage capacity information 120 as learning data (step S601).

[0114] The model generating section 502 calculates the profit based on the model information 110 including the selected model and the usage capacity information 120 (step S602). Specifically, the profit calculating section 502a obtains the model information 110 including the selected model and the usage capacity information 120, and determines whether to increase the profit (step S603) or to decrease the profit (step S604) based on the appropriateness of the model information 110 including the selected model.

[0115] The profit calculating section 502a increases the profit in step S603 in a case where it is determined to increase the profit. On the other hand, the profit calculating section 502a decreases the profit in step S604 in a case where it is determined to decrease the profit.

[0116] The function updating section 502b updates the action value function Q(s t , a t ) represented by Expression 1 stored in the trained model storage section 700 based on the profit calculated by the profit calculating section 502a (step S605).

[0117] The learning device 500 repeatedly performs the above steps S601 to S605, and the trained model storage section 700 stores the generated action value function Q(s t , a t ) as a trained model.

[0118] Figure 17 is a diagram showing a functional structure of the inference device 600. The inference device 600 has a data acquisition section 601 and an inference section 602.

[0119] The data acquisition section 601 acquires the usage capacity information 120 indicating the usage capacity of the project. The data acquisition section 601 is realized by the processor 11. Further, the data acquisition section 601 is one example of the first data acquisition unit.

[0120] The inference section 602 infers the model information of the PLC suitable for executing the project by using the trained model. That is, by inputting the usage capacity information 120 acquired by the data acquisition section 601 to the trained model, it is possible to infer the model information 110 of the PLC suitable for executing the project requiring the usage capacity indicated by the usage capacity information 120. The inference section 602 is realized by the processor 11. Further, the inference section 602 is one example of the inference unit.

[0121] Next, the processing for obtaining the model information 110 using the inference device 600 will be described. Figure 18 The inference processing performed in the programming assistance device 100 will be described. Figure 18 is a flowchart of the inference processing performed in the programming assistance device 100.

[0122] The data acquisition section 601 acquires the usage capacity information 120 (step S701).

[0123] The inference section 602 inputs the usage capacity information 120 to the trained model stored in the trained model storage section 700 to obtain the model information 110 (step S702).

[0124] The inference section 602 outputs the obtained model information 110 to the selection section 105 (step S703).

[0125] The selection section 105 displays the output model information 110 on the screen with highlighting (step S704).

[0126] According to the present embodiment, it is possible to automatically determine the model information of the PLC suitable for executing the project created by the user by learning and inference. Thereby, it is possible to reduce the workload of collecting information required for model selection, and further, it is possible to perform model selection with high reliability.

[0127] (Modified Example)

[0128] The above describes the embodiments of the present application, but when the present application is implemented, modifications and applications realized by various ways can be made.

[0129] In the above-described embodiment 1, the bar chart 307 indicates the ratio, but can indicate the measured value.

[0130] In the above-described embodiment 1, the method of increasing and reducing the allocation capacity allocated to each category of elements is shown, but is not limited thereto. For example, in the case where there are multiple categories of elements having free capacities, a fixed value such as 5 Kbytes is sequentially reduced from the category of elements having a large free capacity, and the allocation capacity of the category of elements exceeding the reduced amount is increased. Then, at the point in time when the increased allocation capacity reaches the usage capacity of the category of elements exceeding, the adjustment processing of reduction and increase is ended. Alternatively, instead of the fixed value, the free capacity can be reduced by a certain percentage, for example, 5%. Alternatively, the user can also determine the priority of reduction in advance for the categories of elements.

[0131] In addition, in the above-described embodiment 2, the programming assistance device 100 includes the learning device 500, the inference device 600, and the trained model storage section 700, but the learning device 500, the inference device 600, and the trained model storage section 700 can also be devices external to the programming assistance device 100. Also, the learning device 500, the inference device 600, and the trained model storage section 700 can also exist on a cloud server. In addition, the learning device 500 and the inference device 600 can also be configured as one device. Also, the learning device 500, the inference device 600, and the trained model storage section 700 can also be configured as one device.

[0132] In addition, in the above-described embodiment 2, the case where the learning algorithm used by the inference section 602 applies reinforcement learning is described, but is not limited thereto. As for the learning algorithm, in addition to reinforcement learning, teacher learning, teacherless learning, or semi-teacher learning, or the like can also be applied.

[0133] In addition, in the above-described embodiment 2, as the learning algorithm used by the model generation section 502, deep learning (Deep Learning) that learns the extraction of the feature amount itself can also be used, and machine learning can also be performed according to other publicly known methods such as neural networks, inductive logic programming, support vector machines, or the like.

[0134] Further, the model generation section 502 can also learn the model information 110 including the selected model using the learning data acquired from a plurality of programming support devices 100. Further, the model generation section 502 can acquire the learning data from a plurality of programming support devices 100 used in the same region, or can learn the model information 110 including the selected model using the learning data collected from a plurality of programming support devices 100 independently operated in different regions. Further, it is also possible to add a programming support device 100 that collects the learning data as a target in the middle, or to remove a target. Further, it is also possible to apply the learning device 500 that has learned the model information 110 including the selected model with respect to a certain programming support device 100 to a different programming support device 100, and to update the model information 110 including the selected model by relearning with respect to the different programming support device 100.

[0135] Further, by applying the action program that specifies the action of the programming support device 100 according to the above-described embodiment to an existing personal computer or information terminal device, it is also possible to cause the personal computer or information terminal device to function as the programming support device 100 according to the embodiment.

[0136] Further, the distribution method of such a program is arbitrary, and for example, the program can be distributed by being stored in a computer-readable recording medium such as a CD-ROM (Compact Disk Read-Only Memory), a DVD (Digital Versatile Disk), a memory card, or the like, or can be distributed via a communication network such as the Internet.

[0137] The present application can realize various embodiments and modifications without departing from the broad spirit and scope of the present application. Further, the above-described embodiments are used to describe the present application, and do not limit the scope of the present application. That is, the scope of the present application is not shown by the embodiments, but is shown by the claims. Further, various modifications implemented within the scope of the claims and the meaning equivalent thereto are considered to be included in the scope of the present application.

[0138] Industrial Applicability

[0139] According to the present application, it is possible to provide a programming support program, a programming support device, and a programming support method that can automatically change the allocation capacity of a memory allocated to each kind of element included in a project to a PLC.

[0140] Explanation of Reference Signs

[0141] 11 processor, 12 main storage unit, 13 auxiliary storage unit, 14 communication unit, 15 input unit, 16 output unit, 17 bus, 100 programming assistance device, 101 calculation unit, 102 decision unit, 103 change unit, 104 display unit, 105 selection unit, 110 model information, 120 usage capacity information, 200 project database, 210 address information, 300, 400 window, 301, 304 column, 302, 303 button, 305, 306, 310 value, 307, 311 bar chart, 308, 405 table, 309 device name, 312 display lower limit value, 313 display upper limit value, 314 pointer, 315 scale, 316 attached information, 317 scroll bar, 318 slider, 401 usage capacity, 402 model number, 403 memory capacity, 404 information, 500 learning device, 501, 601 data acquisition unit, 502 model generation unit, 502a profit calculation unit, 502b function update unit, 600 inference device, 602 inference unit, 700 trained model storage unit.

Claims

1. A programming assistance program product that causes a computer to function as: a calculation unit that acquires information indicating an address space from a database, allocates elements included in a project to an address space indicated by the acquired information, thereby calculating a used capacity of a memory used by the project for each kind of the elements, and calculating an allocatable capacity of the memory according to a range preliminarily allocated in the address space indicated by the acquired information for each kind of the elements, wherein a database that stores information indicating ranges of an address space of a memory of a programmable logic controller that are pre-allocated to each kind of element included in a project executed in the programmable logic controller; a decision unit that decides an allocation capacity of the memory to be allocated to each kind of element included in the project based on a usage capacity calculated for each kind of element and an allocation capacity calculated from the range pre-allocated to each kind of element; a change unit that changes the range pre-allocated to each kind of element in the address space stored in the database based on the allocation capacity of each kind of element decided by the decision unit; and a display unit that displays, for each kind of element, the usage capacity calculated by the calculation unit and the allocation capacity decided by the decision unit on a screen.

2. The programming assistance program product according to claim 1, wherein the display unit displays the usage capacity of the memory used by the element included in the project.

3. The programming assistance program product according to claim 1 or 2, wherein the display unit displays subsidiary information for explaining the element included in the project.

4. The programming assistance program product according to claim 1 or 2, wherein the programming assistance program causes the computer to function as a selection unit that selects a model number of a programmable logic controller suitable for executing the project for which the usage capacity has been calculated based on the usage capacity calculated by the calculation unit and model information that includes both a model number of a programmable logic controller and a memory capacity of the programmable logic controller in association, the display unit highlights the model information including the model number selected by the selection unit.

5. The programming assistance program product according to claim 4, wherein the programming assistance program causes the computer to function as: a first data acquisition unit that acquires usage capacity information indicating the usage capacity of the project calculated by the calculation unit; and an inference unit that infers model information including a model number of a programmable logic controller suitable for executing the project using a trained model for inferring the model information including the model number of the programmable logic controller suitable for executing the project from the usage capacity information indicating the usage capacity of the project, from the usage capacity information acquired by the first data acquisition unit, the selection unit highlights the model information inferred by the inference unit.

6. The programming assistance program product according to claim 5, wherein the programming assistance program causes the computer to function as: a second data acquisition unit that acquires learning data including usage capacity information indicating the usage capacity of the project calculated by the calculation unit and model information including the model number selected by the selection unit; and a model training unit that trains the model for inferring the model information including the model number of the programmable logic controller suitable for executing the project from the usage capacity information indicating the usage capacity of the project using the learning data acquired by the second data acquisition unit. ​ a model generation unit that generates the trained model using the learning data.

7. A programming assistance device having: a calculation unit that acquires information indicating an address space from a database, allocates elements included in a project to an address space indicated by the acquired information, thereby calculating a used capacity of a memory used by the project for each kind of the elements, and calculating an allocatable capacity of the memory according to a range preliminarily allocated in the address space indicated by the acquired information for each kind of the elements, wherein the database stores information indicating that a range is previously allocated to the address space of the memory of the programmable logic controller for each kind of element included in the project executed in the programmable logic controller; a decision unit that decides the allocation capacity of the memory allocated to each kind of element included in the project based on the use capacity calculated for each kind of element and the allocation capacity calculated from the range previously allocated to each kind of element; a change unit that changes the range previously allocated to each kind of element in the address space stored in the database based on the allocation capacity of each kind of element decided by the decision unit; and a display unit that displays the use capacity calculated by the calculation unit and the allocation capacity decided by the decision unit on a screen for each kind of element.

8. A programming assistance method in which, a calculation unit acquires information indicating an address space from a database, allocates elements included in a project to the address space indicated by the acquired information, thereby calculating a use capacity of a memory used by the project for each kind of element, and calculating an allocation capacity of the memory from a range previously allocated to each kind of element in the address space indicated by the acquired information, wherein the database stores information indicating that a range is previously allocated to the address space of the memory of a programmable logic controller for each kind of element included in the project executed in the programmable logic controller, a decision unit decides the allocation capacity of the memory allocated to each kind of element included in the project based on the use capacity calculated for each kind of element and the allocation capacity calculated from the range previously allocated to each kind of element, a change unit changes the range previously allocated to each kind of element in the address space stored in the database based on the allocation capacity of each kind of element decided by the decision unit, a display unit displays the use capacity calculated by the calculation unit and the allocation capacity decided by the decision unit on a screen for each kind of element.

Citation Information

Patent Citations

  • Programmable controller and system, support device thereof, programmable controller, and program

    JP2015125713A

  • Programmable logic controller, program creation support device, control method, and program

    JP2016081300A