Programmable control system, development support device, memory allocation method and program

DE112022005183B4Active Publication Date: 2026-10-22MITSUBISHI ELECTRIC CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
DE112022005183
Authority / Receiving Office
DE · DE
Patent Type
Patents
Current Assignee / Owner
Priority Date
2022-02-10
Filing Date
2022-02-10
Publication Date
2026-10-22
Estimated Expiration
2042-02-10

AI Technical Summary

Technical Problem

Existing programmable control systems face performance degradation due to increased processing time when variables are repeatedly added to program organization units (POUs), as they require multiple levels of additional memory areas and longer access times.

Method used

A programmable control system that compiles source code to generate a machine language object, using a compiler and variable addition responder to define or relocate additional variable storage areas in free space, updating addresses to access variables based on a single address, thus avoiding performance reduction.

Benefits of technology

This approach reduces processing time by accessing additional variables efficiently, maintaining program execution performance even with repeated variable additions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

A programmable control system (100) comprises a compiler (12) which stores in an initial variable memory area in a memory area in a programmable controller an initial variable in a program organization unit (POE) with variables contained in a source code of a program for the programmable controller written with the POE, and an additional variable memory address which specifies an address of an additional variable memory area for storing a variable added to the POE, upon determining that a variable has been added to the POE, stores all additional variables associated with the POE with the added variable in the additional variable memory area in the memory area, determines whether a variable has been added to the POE, and compiles the source code, thereby generating the machine language object;and a variable addition responder (28) which, upon determining that a variable has been added to the POE, defines or moves the additional variable memory location to a free space in the memory area and updates the additional variable memory address.
Need to check novelty before this filing date? Find Prior Art

Description

Technical area

[0001] The present disclosure relates to a programmable control system, a development support device, a memory allocation method and a program. State of the art

[0002] A program for a programmable logic controller (PLC) typically comprises functional units called program organization units (POEs), containing variables. If a PLC program needs to be modified during operation, the address of each variable within a POE, stored in a memory area of ​​the PLC, cannot be changed. Such a change in variable address results in accessing memory that differs from the memory before the address change, leading to malfunction of the PLC. To prevent this, the memory area includes reserve areas where variables added to the POE are stored. However, large areas cannot be predefined as such reserve areas, which would remain unused without the addition of variables.The variables initially stored in the memory area are hereinafter referred to as initial variables, and the variables added to the POE are hereinafter referred to as additional variables.

[0003] Patent document 1 describes a programmable control system which, when more variables than the number of reserve areas are added, defines an additional area in a free area and stores the address of the additional area in the reserve area. The technique described in patent document 1 allows access to additional variables stored in the additional area via the address stored in the reserve area when such access is initiated by the program for the programmable control. Citation list of patent literature

[0004] Patent literature 1: unexamined Japanese patent application, publication number 2012-234272 Brief description of the invention: Technical problem

[0005] In the technique described in patent literature 1, the address stored in the reserve area is read to access the additional variables stored in the additional area. Such access requires a longer processing time than accessing the initial variables. If variables are to be added whose size exceeds the additional area, another additional area is defined in the free space. This creates additional areas of multiple levels and makes the additional variables accessible via multiple addresses. This further increases the processing time. With the technique described in patent literature 1, the execution performance of the program can decrease with repeated addition of variables.

[0006] In response to the above circumstance, one objective of the present disclosure is to avoid a reduction in program execution performance through repeated addition of variables to a POE. Solution to the problem

[0007] To achieve the above objective, a programmable control system according to one aspect of the present disclosure is a programmable control system that compiles source code of a program for a programmable controller, thereby generating a machine language object, and that causes the programmable controller to execute the machine language object. The programmable control system according to this aspect of the present disclosure comprises a compiler and a variable addition responder.The compiler stores an initial variable in a program organization unit containing variables, which is included in the source code written with the program organization unit, and an additional variable memory address, which specifies the address of an additional variable memory area for storing a variable added to the program organization unit, upon determining that a variable has been added to the program organization unit, stores all additional variables associated with the program organization unit with the added variable in the additional variable memory area, determines whether a variable has been added to the program organization unit, and compiles the source code, thereby producing the machine language object.The variable addition responder, upon determining that a variable has been added to the program organization unit, defines or moves the additional variable memory location for the program organization unit containing the added variable to a free space in the memory area and updates the additional variable memory address. Advantageous effects of the invention

[0008] In the programmable control system according to the above aspect of the present disclosure, when a variable is added to the program organization unit, an additional variable memory area is defined or moved into a free space in the memory area, and the address of the additional variable memory area is updated for access to the added variable based on the position relative to a single address, in order to avoid a decrease in the execution performance of the program by repeatedly adding variables to the program organization unit. Brief description of the drawings Fig. Figure 1 is a functional block diagram of a programmable control system according to embodiment 1; Fig. Figure 2 is a diagram showing an example of adding variables to a Program Organization Unit (POE); Fig. 3 is a schematic diagram that describes a memory allocation using a known technique when adding the variables to the POE; Fig. Figure 4 is a schematic diagram that describes a memory allocation in the programmable control system according to embodiment 1 when adding the variables to the POE; Fig. 5A is a set of tables showing examples of instance information and variable information in embodiment 1; Fig. 5B is a set of tables showing examples of instance information, variable information and variable addition information in embodiment 1 when additional variables 1 to 3 are added; Fig. 5C is a set of tables showing examples of instance information, variable information and variable addition information in embodiment 1 when additional variables 4 to 6 are added; Fig. 6 is a flowchart of the memory allocation in embodiment 1; Fig. 7 is a schematic diagram that describes a memory allocation when adding variables to POEs in embodiment 2; Fig. Figure 8 is a schematic diagram showing an example of adding variables to POEs when one POE calls another POE; Fig. Figure 9 is a schematic diagram that describes a memory allocation using shared additional variable memory addresses when adding variables to the POEs; Fig. Figure 10 is a schematic diagram describing a memory allocation in a programming control system according to embodiment 3 when variables are added to the POEs; and Fig. Figure 11 is a diagram of a development support device according to embodiments 1 to 3, showing the hardware configuration. Description of embodiments

[0009] A programmable control system, a development support device, a memory allocation method, and a program according to one embodiment are described in detail below with reference to the drawings. Identical reference numerals denote identical or corresponding components in the drawings. A programmable controller is hereinafter referred to as a programmable logic controller (PLC). In the present embodiment, source code for a PLC program is written with functional units, which are referred to as program organization units (POEs), each comprising variables. The POEs are of, for example, one of three types, in particular a program (PROGRAM), a function block (FB), and a function (FUN). In the embodiment described below, variables are added to one or more FBs. Each FB is activated by a program or by another FB that calls the FB.The FB denotes a type of POE. To call an FB, an instance is declared using the instance name. Design 1

[0010] As in Fig. As shown in Figure 1, a programmable control system 100 comprises a development support device 1, which generates a program for a PLC 2 and writes the program to the PLC 2, and the PLC 2, which executes the program generated by the development support device 1.

[0011] The development support device 1 includes a source code memory 11, which stores source code of the program for the PLC 2, and a compiler 12, which compiles the source code stored in the source code memory 11, determines whether variables have been added to a POE, and creates a machine language object to be executed by the PLC 2.

[0012] The development support device 1 further comprises a variable addition information generator 14, which, upon determining that variables have been added to a POE, generates variable addition information that causes the PLC 2 to store the variables in a memory area; an instance information memory 15, which stores instance information that specifies an allocation of the memory area in the PLC 2 for instances in the POE; a variable information memory 16, which stores variable information that specifies the variables contained in the POE; a machine language object memory 17, which stores the machine language object generated by the compiler 12; a variable addition information memory 18, which stores variable addition information generated by the variable addition information generator 14; and a communicator 19.which transmits information to and receives from PLC 2. The instance information is an example of memory allocation information.

[0013] The PLC 2 comprises a communicator 21, which transmits information to and receives information from the development support device 1; a machine language object memory 24, which stores the machine language object received from the development support device 1; a variable addition information memory 25, which stores the variable addition information received from the development support device 1; and an instance memory area 26, in which the instances of the POE are located. The PLC 2 further comprises a program executor 27, which executes the machine language object stored in the machine language object memory 24; and a variable addition responder 28, which moves the variables in the instance memory area 26 based on the variable addition information stored in the variable addition information memory 25.

[0014] Source code memory 11 in development support device 1 stores the source code of the program for PLC 2. When the source code stored in source code memory 11 is updated, compiler 12 stores initial variables in the POE, which is included in the updated source code, and additional variable memory addresses, which specify the addresses of additional variable memory areas that store the variables added to the POE, in an initial variable memory area in instance memory area 26 and compiles the source code. This generates the instance information, the variable information, and the machine language object.

[0015] Compiler 12 compares the instance information and variable information of the program before the update, which are stored in instance information memory 15 and variable information memory 16 respectively, with the generated instance information and variable information to determine whether variables have been added to a POE. If compiler 12 determines that variables have been added to a POE, variable addition information generator 14 generates the variable addition information, which contains the source and destination addresses of the additional variable memory areas for the instances of the POE with added variables.

[0016] Compiler 12 updates the instance information stored in instance information memory 15 to the generated instance information. Compiler 12 updates the variable information stored in variable information memory 16 to the generated variable information. Machine language object memory 17 stores the machine language object generated by compiler 12. Variable addition information memory 18 stores the variable addition information generated by variable addition information generator 14. Communicator 19 transmits the machine language object and the variable addition information to PLC 2.

[0017] Communicator 21 in PLC 2 stores the machine language object in machine language object memory 24 and stores the variable addition information received from development support device 1 in variable addition information memory 25. Program executor 27 places the instances of the POE contained in the machine language object stored in machine language object memory 24 in instance memory area 26 and updates the machine language object to be executed. Based on the variable addition information stored in variable addition information memory 25, variable addition responder 28 defines or relocates the additional variable memory areas for the instances of the POE with the added variables to a free space in instance memory area 26 and updates the additional variable memory addresses to the target addresses.When variables are added to a POE, the program executor 27 stores the added variables in the defined or relocated Additional Variable memory areas and updates the machine language object to be executed.

[0018] Fig. Figure 2 shows an example of adding variables to a POE. In the example in Fig. In step 2, a calling program calls an instance 1 of an FB1 type, an instance 2 of an FB2 type, and an instance 3 of an FB1 type. The FB1 type program includes a variable 1 and a variable 2. The FB2 type program includes a variable 3 and a variable 4. Three variables (additional variables 1 to 3) are added, and three more variables (additional variables 4 to 6) are further added to the FB1 type program.

[0019] With reference to Fig. Section 3 describes the storage of variables in the instance memory area 26 using the technique described in patent literature 1. As in Fig. As shown in Figure 2, this is done when the three variables (additional variables 1 to 3) are added and then the three further variables (additional variables 4 to 6) are added to the program of type FB1.

[0020] As in Fig. As shown in Figure 3, in the technique described in patent literature 1, when the three variables (additional variables 1 to 3) are added to the program of type FB1, the additional variable 1 is stored in a reserve area (Reserve 1) in instance 1 of type FB1, and an additional variable memory area A1 for instance 1 is defined in the free space to store the additional variables 2 and 3. The address of the additional variable memory area A1 for instance 1 is stored as the additional variable memory address in instance 1. The additional variable memory area A1 for instance 1 comprises a new reserve area (Reserve 1) and a new additional variable memory address.

[0021] Similarly, when the three variables (additional variables 1 to 3) are added to the program of type FB1, additional variable 1 is stored in a reserve area (Reserve 1) in instance 3 of type FB1, and an additional variable memory area A2 for instance 3 is defined in the free space to store additional variables 2 and 3. The address of the additional variable memory area A2 for instance 3 is stored as the additional variable memory address in instance 3. The additional variable memory area A2 for instance 3 includes a new reserve area (Reserve 1) and a new additional variable memory address.

[0022] When the three additional variables (additional variables 4 to 6) are added to the FB1-type program, additional variable 4 is stored in the reserve area (Reserve 1) within the additional variable memory area A1 for instance 1, and an additional variable memory area A3 for instance 1 is defined in the free space to store additional variables 5 and 6. The address of additional variable memory area A3 for instance 1 is stored as the additional variable memory address in additional variable memory area A1. Additional variable memory area A3 for instance 1 includes a new reserve area (Reserve 1) and a new additional variable memory address.

[0023] Similarly, when the three additional variables (additional variables 4 to 6) are added to the FB1-type program, additional variable 4 is stored in the reserve area (Reserve 1) within the additional variable memory area A2 for instance 3, and an additional variable memory area A4 for instance 3 is defined in the free space to store additional variables 5 and 6. The address of additional variable memory area A4 for instance 3 is stored as the additional variable memory address in additional variable memory area A2 for instance 3. Additional variable memory area A4 for instance 3 includes a new reserve area (Reserve 1) and a new additional variable memory address.

[0024] As described above, with the technique described in patent literature 1, repeated addition of variables creates additional areas of several levels and causes the additional variables to be accessible via more addresses, which increases the processing time.

[0025] With reference to Fig. Section 4 describes the storage of variables in the instance memory area 26 in the programmable control system 100 according to embodiment 1. As in Fig. As shown in Figure 2, this is done when the three variables (additional variables 1 to 3) are added and the three further variables (additional variables 4 to 6) are added to the program of type FB1.

[0026] As in Fig. As shown in Figure 4, when the three variables (additional variables 1 to 3) are added to the program of type FB1, the additional variable memory area A1 for instance 1 is defined in the free space to store the additional variables 1 to 3. The additional variable memory address in instance 1 is updated to the address of the additional variable memory area A1 for instance 1.

[0027] Similarly, when the three variables (additional variables 1 to 3) are added to the program of type FB1, the additional variable memory area A2 for instance 3 is defined in the free space to store the additional variables 1 to 3. The additional variable memory address in instance 3 is updated to the address of the additional variable memory area A2 for instance 3.

[0028] When the three additional variables (additional variables 4 to 6) are added to the FB1-type program, the additional variable memory area A3 for instance 1 is defined in the free space to store the additional variables 1 to 6. The additional variable memory address in instance 1 is updated to the address of the additional variable memory area A3 for instance 1.

[0029] Similarly, when the three additional variables (additional variables 4 to 6) are added to the FB1-type program, the additional variable memory area A4 for instance 3 is defined in the free space to store the additional variables 1 to 6. The additional variable memory address in instance 3 is updated to the address of the additional variable memory area A4 for instance 3.

[0030] As described above, when variables are added to a POE in the programmable control system 100, all additional variables added to the instances of the POE are stored in the additional variable memory areas, which are located in the free space in the instance memory area 26, and the additional variable memory addresses are updated to the target addresses. Therefore, when the variables are added repeatedly, the additional variables are accessed based on their position relative to a single address. This technique can thus further reduce the processing time compared to the technique described in patent literature 1. The PLC repeatedly performs arithmetic operations caused by the program and system processing during operation.In the programmable control system 100, the relocation of additional variables to the instance memory area 26 is performed during system processing and therefore increases the system processing time. However, the time required for arithmetic operations caused by the program is typically much longer than the system processing time, and the system processing time only temporarily increases during the relocation of additional variables. Nevertheless, the technique can reduce the processing time without significantly impacting it.

[0031] The instance information, variable information, and variable addition information are now displayed with reference to Fig. Sections 5A to 5C are described. These information elements are presented as described in Fig. Figure 4 is shown, generated when the three variables (additional variables 1 to 3) are added and the three further variables (additional variables 4 to 6) are added to the program of type FB1.

[0032] If the source code calls instance 1 of type FB1 with variables 1 and 2, instance 2 of type FB2 with variables 3 and 4, and instance 3 of type FB1, compiler 12, for example, generates the instance information and variable information that are in Fig. 5A are shown.

[0033] In the example in Fig. 5A includes the instance information: the instance number to identify the instances, the POE type, which specifies the POE types of the instances, the leading address, which specifies the leading addresses of the memory area in which the instances are placed, the instance size, which specifies the sizes of the instances, the additional variable memory address, which specifies the addresses of the additional variable memory for the instances, and the additional variable memory size, which specifies the sizes of the additional variable memories. The value of each additional variable memory address is zero before the variables are added, when no additional variable memory area is defined. In the example in Fig. 5A includes the variable information the POE type, which specifies the POE types of the variables, the memory, which specifies the memory locations where the variables are stored, the variable name, which specifies the names of the variables, the data type, which specifies the data types of the variables, the size, which specifies the sizes of the variables, and the relative address, which specifies the relative addresses of the variables in the memory area where the instances are placed.

[0034] When the additional variables 1 to 3 are added to the program of type FB1, the compiler 12 generates the instance information and the variable information, and the variable addition information generator 14 generates the variable addition information, as shown in Fig. 5B is shown.

[0035] In the example in Fig. 5B includes the variable addition information, the information number for identifying elements of the variable addition information, the source address, which specifies the source addresses of the additional variable memory areas for the instances that are moved when additional variables 1 to 3 are added, the destination address, which specifies the destination addresses of the additional variable memory areas for the instances that are moved when additional variables 1 to 3 are added, the size, which specifies the total size of additional variables 1 to 3, and the leading address, which specifies the addresses where the additional variable memory addresses are stored. When an additional variable memory area is defined for the first time in the free space, the value of the source address is zero, with no additional variable memory area located at the source address.The addresses of the additional variable memory areas defined for the instances are entered as the additional variable memory address in the instance information. Information about additional variables 1 to 3 is entered as the variable name, data type, size, and relative address in the variable information.

[0036] Furthermore, if the additional variables 4 to 6 are added to the program of type FB1, the compiler 12 generates the instance information and the variable information, and the variable addition information generator 14 generates the variable addition information, which, for example, in Fig. 5C is shown.

[0037] In the example in Fig. In step 5C, the source addresses of the additional variable memory areas for the instances, which are relocated when adding additional variables 4 to 6, are entered as the source address contained in the variable addition information. The destination addresses of the additional variable memory areas for the instances, which are relocated when adding variables 4 to 6, are entered as the destination address in the variable addition information. The addresses in the additional variable memory address field in the instance information are updated to the addresses of the relocated additional variable memory areas for the instances. Information about the additional variables 4 to 6 is entered into the variable information field as the variable name, data type, size, and relative address.

[0038] A memory allocation performed by the programmable control system 100 is now being evaluated with reference to Fig. 6 described. The in Fig. The memory allocation shown in Figure 6 begins when the source code of the program for PLC 2, stored in source code memory 11, is updated.

[0039] Compiler 12 stores the initial variables in the POEs, which are contained in the updated source code of the program for PLC 2, and the additional variable memory addresses, which specify the addresses of additional variable memory areas, in the initial variable memory areas in instance memory area 26 when variables are added, and compiles the source code (step S11). This generates the instance information, the variable information, and the machine language object. In step S11, when variables are added to one of the POEs, Compiler 12 stores all additional variables associated with the POE containing the added variables in the additional variable memory areas in instance memory area 26 and compiles the source code.

[0040] Compiler 12 compares the instance information and variable information of the program before the update, which are stored in instance information memory 15 and variable information memory 16 respectively, with the generated instance information and variable information to determine whether variables have been added to any of the POEs in the source code (step S12). If no variable has been added to the POEs in the source code (no in step S12), processing proceeds to step S15. If variables have been added to any of the POEs in the source code (yes in step S12), the variable addition information generator 14 generates the variable addition information, which contains the source and destination addresses of the additional variable memory areas for the instances of the POE with the added variables (step S13).

[0041] For example, in Fig. As shown in step 4, in step S13 the variable addition information, such as in Fig. As shown in 5B, this is generated when the additional variables 1 to 3 are added to the program of type FB1. In step S13, the variable addition information, as shown in Fig. 5C is shown, generated when the additional variables 4 to 6 are added to the program of type FB1.

[0042] Referring again to Fig. 6. The communicator 19 in the development support device 1 transmits the variable addition information generated by the variable addition information generator 14 to the PLC 2 (step S14) and transmits the machine language object generated by the compiler 12 to the PLC 2 (step S15).

[0043] If communicator 21 in PLC 2 does not receive variable addition information from development support device 1 (no in step S16), processing proceeds to step S19. If communicator 21 receives variable addition information from development support device 1 (yes in step S16), variable addition responder 28, based on the variable addition information received from development support device 1, relocates the additional variable memory areas for the POE instances with the added variables (step S17) and updates the additional variable memory addresses to the target addresses (step S18).

[0044] If, for example, the communicator 21 is connected to the development support device 1 in step S16, the Fig. Upon receiving the variable addition information shown in Figure 5B, the variable addition responder 28 defines an additional variable memory area for instance 1 of the FB1 type at address 1024 and an additional variable memory area for instance 3 of the FB1 type at address 1030 in step S17. In step S18, the variable addition responder 28 updates the additional variable memory address in instance 1 of the FB1 type to 1024 and the additional variable memory address in instance 3 of the FB1 type to 1030.

[0045] If the communicator 21 from the development support device 1 in step S16 furthermore the in Fig. Upon receiving the variable addition information shown in Figure 5C, the variable addition responder 28, based on this information, moves the additional variable memory area for instance 1 of type FB1 from address 1024 to address 1036 and the additional variable memory area for instance 3 of type FB1 from address 1030 to address 1048 in step S17. In step S18, the variable addition responder 28 updates the additional variable memory address in instance 1 of type FB1 to 1036 and the additional variable memory address in instance 3 of type FB1 to 1048.

[0046] Referring again to Fig. In step 6, the program executor 27 places instances of the POEs contained in the machine language object received by communicator 21 from development support device 1 into instance memory area 26 in PLC 2, updates the machine language object to be executed (step S19), and terminates processing. If variables are added to a POE, in step S19, the program executor 27 stores the additional variables in the additional variable memory area, which was moved in step S17, and updates the machine language object to be executed.

[0047] In the programmable control system 100 according to embodiment 1, when it is determined that a variable has been added to a function block (FB), an additional variable memory area is defined or moved into the free space within the memory area, and the additional variable memory address is updated for access to the added variable based on its position relative to a single address. This can prevent a reduction in the program's execution performance due to repeated additions of variables to the FB. Design 2

[0048] In embodiment 2, each instance includes a reserve area and, if the total size of additional variables exceeds the size of the reserve area, an additional variable memory area is defined in a free area to store the additional variables.

[0049] With reference to Fig. Section 7 describes the storage of variables in the instance memory area 26 in the programmable control system 100 according to embodiment 2. This is performed when three variables (additional variables 1 to 3) are added, two further variables (additional variables 4 and 5) are added, and two further variables (additional variables 6 and 7) are added to a program of FB1 type.

[0050] As in Fig. As shown in Figure 7, when the three variables (additional variables 1 to 3) are added to the program of type FB1, additional variables 1 and 2 are stored in a reserve area for instance 1 of type FB1, and additional variable 3, with a size exceeding the reserve area, is stored in an additional variable memory area A1 for instance 1, which is defined in the free space. The address of the additional variable memory area A1 for instance 1 is stored as the additional variable memory address in instance 1. The additional variable memory area A1 for instance 1 comprises a new reserve area.

[0051] Similarly, when the three variables (additional variables 1 to 3) are added to the program of type FB1, additional variables 1 and 2 are stored in a reserve area in instance 3 of type FB1, and additional variable 3, with a size exceeding the reserve area, is stored in an additional variable memory area A2 for instance 3, which is defined in the free space. The address of the additional variable memory area A2 for instance 3 is stored as the additional variable memory address in instance 3. The additional variable memory area A2 for instance 3 includes a new reserve area.

[0052] When the two variables (additional variables 4 and 5) are added to the program of type FB2, they are stored in a reserve area in instance 2 of type FB2. Furthermore, when the two variables (additional variables 4 and 5) are added to the program of type FB1, they are stored in the reserve area in the additional variable memory area A1 for instance 1 and in the reserve area in the additional variable memory area A2 for instance 3. The reserve areas in instances 1 through 3 are examples of first reserve areas. The reserve areas in additional variable memory areas A1 and A2 are examples of second reserve areas.

[0053] In the programmable control system 100 according to embodiment 2, when it is determined that a variable has been added to the function block (FB), an additional variable memory area is defined or moved into the free space within the memory area, and the additional variable memory address is updated to access the added variable based on its position relative to a single address. This can prevent a decrease in program execution performance due to repeated additions of variables to the FB. If the size of additional variables does not exceed the reserve area, the variables are stored in the reserve area without being moved to the additional variable memory area, thus reducing the increase in processing time. embodiment 3

[0054] In embodiment 3, when one FB calls another FB, an additional variable memory address is used for each instance.

[0055] Fig. Figure 8 shows an example of adding variables to a POE when that POE calls another POE. In the example in Fig. In step 8, the calling program calls instance 1 of type FB1 and instance 3 of type FB1. The FB1 program includes variable 1 and variable 2 and calls an instance of type FB2. At instance 1, the program calls instance 2 of type FB2. At instance 3, the program calls instance 4 of type FB2. The FB2 program includes variable 3 and variable 4. Three variables (additional variables 1 to 3) are added to the FB1 program, three more variables (additional variables 4 to 6) are added to the FB2 program, and three more variables (additional variables 7 to 9) are added to the FB1 program.

[0056] With reference to Fig. Section 9 describes the storage of variables in instance memory area 26. This is performed when, as in Fig. Figure 8 shows that three variables (additional variables 1 to 3) are added to the program of type FB1, two variables (additional variables 4 and 5) are added to the program of type FB2, and two further variables (additional variables 6 and 7) are added to the program of type FB1. In this example, the calling FB and the called FB share an additional variable memory address.

[0057] As in Fig. As shown in Figure 9, if the calling FB and the called FB share the additional variable memory address and the three variables (additional variables 1 to 3) are added to the program of type FB1, an additional variable memory area A1 for instance 1 is defined in the free space to store the additional variables 1 to 3. The address of the additional variable memory area A1 for instance 1 is stored as the additional variable memory address shared by instance 1 and instance 2.

[0058] Similarly, when the three variables (additional variables 1 to 3) are added to the program of type FB1, the additional variable memory area A2 for instance 3 is defined in the free space to store the additional variables 1 to 3. The address of the additional variable memory area A2 for instance 3 is stored as the additional variable memory address shared by instance 3 and instance 4.

[0059] When the other three variables (additional variables 4 to 6) are added to the FB2-type program, an additional variable memory area A3 for instance 1 and an additional variable memory area A5 for instance 2 are sequentially defined in the free space to store the additional variables 1 to 6. The additional variable memory address shared by instance 1 and instance 2 is updated to the address of the additional variable memory area A3 for instance 1.

[0060] Similarly, when the other three variables (additional variables 4 to 6) are added to the FB1-type program, an additional variable memory area A4 for instance 3 and an additional variable memory area A6 for instance 4 are sequentially defined in the free space to store the additional variables 1 to 6. The additional variable memory address shared by instance 3 and instance 4 is updated to the address of the additional variable memory area A4 for instance 3.

[0061] When the three additional variables (additional variables 7 to 9) are added to the FB1-type program, an additional variable memory area A7 for instance 1, an additional variable memory area A8 for instance 2, and an additional variable memory area A9 for instance 1 are sequentially defined in the available space to store the additional variables 1 to 9. The address of the additional variable memory area A7 for instance 1 is stored as the additional variable memory address shared by instance 1 and instance 2.

[0062] Similarly, when the three additional variables (additional variables 7 to 9) are added to the FB1-type program, an additional variable memory area A10 for instance 3, an additional variable memory area A11 for instance 4, and an additional variable memory area A12 for instance 3 are sequentially defined in the free space to store the additional variables 1 to 9. The address of the additional variable memory area A10 for instance 3 is stored as the additional variable memory address shared by instance 3 and instance 4.

[0063] As described above, if the calling FB and the called FB share an additional variable memory address and variables are added to the calling FB, the additional variables in the called FB are moved in addition to the additional variables in the calling FB. The PLC repeats a program execution but interrupts the program execution (performs final processing) to move the additional variables without affecting operation. A large number of additional variables being moved therefore requires more time, which increases the program execution time (interval time) for a program execution.

[0064] With reference to Fig. Section 10 describes the storage of variables in the instance memory area 26 in the programmable control system 100 according to embodiment 3. As in Fig. As shown in Figure 8, this is done when three variables (additional variables 1 to 3) are added to the program of FB1 type, two variables (additional variables 4 and 5) are added to the program of FB2 type, and two further variables (additional variables 6 and 7) are added to the program of FB1 type.

[0065] As in Fig. As shown in Figure 10, when the three variables (additional variables 1 to 3) are added to the program of type FB1, the additional variable memory area A1 for instance 1 is defined in the free space to store the additional variables 1 to 3. The address of the additional variable memory area A1 for instance 1 is stored as the additional variable memory address in instance 1.

[0066] Similarly, when the three variables (additional variables 1 to 3) are added to the program of type FB1, the additional variable memory area A2 for instance 3 is defined in the free space to store the additional variables 1 to 3. The address of the additional variable memory area A2 for instance 3 is stored as the additional variable memory address shared by instance 3 and instance 4.

[0067] When the other three variables (additional variables 4 to 6) are added to the FB2-type program, the additional variable memory area A5 for instance 2 is defined in the free space to store the additional variables 4 to 6. The address of the additional variable memory area A5 for instance 2 is stored as the additional variable memory address in instance 2.

[0068] Similarly, when the other three variables (additional variables 4 to 6) are added to the FB2-type program, the additional variable memory area A6 for instance 4 is defined in the free space to store the additional variables 4 to 6. The address of the additional variable memory area A5 for instance 4 is stored as the additional variable memory address in instance 4.

[0069] When the three additional variables (additional variables 7 to 9) are added to the FB1-type program, the additional variable memory areas A7 and A9 for instance 1 are sequentially defined in the free space to store additional variables 1 to 3 and additional variables 7 to 9, respectively. The address of the additional variable memory area A7 for instance 1 is stored as the additional variable memory address in instance 1.

[0070] Similarly, when the three additional variables (additional variables 7 to 9) are added to the FB1-type program, the additional variable memory areas A10 and A12 for instance 3 are sequentially defined in the free space to store the additional variables 1 to 3 and the additional variables 7 to 9, respectively. The address of the additional variable memory area A10 for instance 3 is stored as the additional variable memory address in instance 3. In other words, in the programmable control system 100 according to embodiment 3, the additional variable memory areas A5 and A6 are not relocated, which reduces the increase in program execution time.

[0071] In the programmable control system 100 according to embodiment 3, when it is determined that a variable has been added to the FB, an additional variable memory area is defined or moved into the free space within the memory area, and the additional variable memory address is updated to access the added variable based on its position relative to a single address. This can prevent a decrease in program execution performance due to repeated additions of variables to the FB. When one FB calls another, an additional variable memory address is used for each instance. This can reduce the increase in program execution time compared to the case where an additional variable memory is shared by the calling FB and the called FB.

[0072] In embodiments 1 to 3 described above, the source code memory 11 in the development support device 1 stores the source code of the program for the PLC 2. In some embodiments, the development support device 1 can receive input of the source code of the program for the PLC 2. In this case, the development support device 1 causes the source code memory 11 to store the input source code of the program for the PLC 2.

[0073] In embodiments 1 to 3 described above, the development support device 1 comprises the source code memory 11, the instance information memory 15, the variable information memory 16, the machine language object memory 17, and the variable addition information memory 18. In some embodiments, for example, an external device or system may comprise the instance information memory 15, the variable information memory 16, the machine language object memory 17, and the variable addition information memory 18.

[0074] The hardware configuration of the development support device 1 is described with reference to Fig. 11 described. As in Fig. As shown in Figure 11, the development support device 1 comprises a temporary memory 111, a memory 112, a calculator 113, an input device 114, a transmitter / receiver 115, and a display 116. The temporary memory 111, the memory 112, the input device 114, the transmitter / receiver 115, and the display 116 are connected to the calculator 113 via a bus.

[0075] The computer 113, for example, is a central processing unit (CPU). The computer 113 performs the processing of the compiler 12 in the development support device 1 and the variable addition information generator 14 based on a control program stored in the memory 112.

[0076] Temporary memory 111, for example, is a random access memory (RAM). The control program stored in memory 112 is loaded into temporary memory 111, and temporary memory 111 is used as a workspace for the computer 113.

[0077] Memory 112 is a non-volatile memory, such as flash memory, a hard disk, a Digital Versatile Disk RAM (DVD-RAM), or a DVD Rewritable (DVD-RW). Memory 112 pre-stores the program that instructs the computer 113 to process the development support device 1, provides data stored in the program to the computer 113 as instructed by the computer 113, and stores data provided by the computer 113. The instance information memory 15, the variable information memory 16, the machine language object memory 17, and the variable addition information memory 18 are contained within memory 112.

[0078] The input device 114 comprises an input device, such as a keyboard and a pointing device, and an interface that connects the input device, such as a keyboard and a pointing device, to the bus. Information entered by a user is provided to the computer 113 by the input device 114. In the structure in which the development support device 1 receives the input of the source code of the program for the PLC 2, the user enters the source code of the program for the PLC 2 into the input device 114.

[0079] The transceiver 115 comprises a network terminal or radio communication device connected to a network and a serial interface or a local area network (LAN) interface connected to the network terminal or communication device. The transceiver 115 operates as the communicator 19.

[0080] Display 116, for example, is a cathode ray tube (CRT) or a liquid crystal display (LCD). Display 116 shows, for example, an operating screen through which the user enters information. In the setup where the development support device 1 receives the input of the source code for the PLC 2 program, display 116 shows a screen so that the user can enter the source code for the PLC 2 program.

[0081] The processes, which are carried out by the source code memory 11, the compiler 12, the variable addition information generator 14, the instance information memory 15, the variable information memory 16, the machine language object memory 17, the variable addition information memory 18 and the communicator 19 in the in Fig.The development support device 1 shown in 1 is implemented by the control program using resources which include the temporary memory 111, the calculator 113, the memory 112, the input device 114, the transmitter / receiver 115 and the display 116.

[0082] The hardware configuration and flowcharts are merely examples and can be changed or modified as appropriate.

[0083] The main components that perform the processing of the development support device 1, which includes the calculator 113, the temporary memory 111, the memory 112, the input device 114, the transceiver / receiver 115, and the display 116, can be implemented using a standard computer system instead of a dedicated system. For example, a computer program executable to implement the above operation can be stored for distribution on a non-volatile, computer-readable recording medium, such as a floppy disk, a compact disc read-only memory (CD-ROM), or a DVD-ROM. The computer program can be installed on a computer to provide the development support device 1, which performs the above processing.In some embodiments, the computer program may be stored in a storage device contained in a server device on a communication network, such as the Internet, and may be downloaded by a standard computer system to implement the development support device 1.

[0084] In the system with the above functions of the development support device 1, which can be implemented partly by the operating system (OS) and partly by an application program or by cooperation between the OS and the application program, sections that can be executed by the application program, which is different from the OS, can be stored in a non-volatile recording medium or a storage device.

[0085] The computer program can be superimposed on a carrier wave to be deployed over a communication network. For example, the computer program can be posted to a bulletin board system (BBS) on the communication network to be deployed over the communication network. The computer program can be activated and executed under the control of the operating system in the same way as any other application program to perform the processing described above.

[0086] The foregoing describes some exemplary embodiments for illustrative purposes. Although the preceding discussion has presented specific embodiments, the person skilled in the art understands that changes in form and detail can be made without departing from the broader spirit and scope of the invention. Accordingly, the description and drawings are to be understood as explanatory rather than restrictive. This detailed description is therefore not to be understood in a limiting sense, and the scope of the invention is defined solely by the appended claims, together with the full range of equivalents attributable to such claims. Reference symbol list 1 Development support device 2 PLCs 11 Source code storage 12 Compilers 14 Variable Addition Information Generators 15 instance information storage 16 variable information storage 17 Machine Language Object Memory 18 Variable Addition Information Storage 19 Communicator 21 Communicator 24 machine language object memories 25 Variable Addition Information Storage 26 instance memory area 27 program executors 28 variable addition responders 100 programmable control systems 111 Temporary storage 112 storage locations 113 Calculators 114 inputters 115 Transducers / Receivers 116 ads QUOTES INCLUDED IN THE DESCRIPTION

[0000] This list of documents cited by the applicant was automatically generated and is included solely for the reader's convenience. The list is not part of the German patent or utility model application. The DPMA accepts no liability for any errors or omissions. Cited patent literature

[0000] JP 2012234272

[0004]

Claims

[1] A programmable controller system that compiles source code of a program for a programmable controller, thereby creating a machine language object, and causing the programmable controller to execute the machine language object, the programmable controller system comprising: a compiler which stores, in an initial variable storage area in a memory area in the programmable controller, an initial variable in a program organization unit with variables included in the source code written with the program organization unit, and an additional variable storage address indicating an address of an additional variable storage area for storing a variable added to the program organization unit, determines whether a variable has been added to the program organizational unit, upon determining that a variable has been added to the program organization unit, stores all additional variables associated with the program organization unit with the added variable in the additional variable storage area in the storage area, and compiles the source code, creating the machine language object; and a variable addition reactant, which upon determining that a variable has been added to the program organization unit, defines or moves the additional variable storage area for the program organization unit with the added variable into a free space in the storage area, and the additional variable memory address is updated. [2] A programmable control system according to claim 1, wherein the compiler when compiling the source code, a first reserve area is defined in the initial variable storage area and a second reserve area is defined in the additional variable storage area, upon determining that a variable has been added to the program organizational unit, stores the additional variables associated with the program organizational unit with the added variable in the first reserve area and, if a total size of the additional variables exceeds a size of the first reserve area, stores an additional variable of the additional variables not stored in the first reserve area in the additional variable storage area, and the variable addition responder when the compiler determines that a variable associated with the program organization unit has been added and the total size of the additional variables associated with the program organization unit with the added variable exceeds the size of the first reserve area, defines the additional variable storage area in the free space in the storage area, if the total size of the additional variables associated with the program organization unit with the added variable exceeds a size of the second reserve area, moves the additional variable storage area into the free space in the storage area and the additional variable memory address is updated. [3] The programmable control system according to claim 1 or 2, wherein, when compiling the source code, when a function block which is a type of the program organization unit calls another function block, the compiler stores the additional variable storage address for each function block in the initial variable storage area. [4] A development support device for compiling a source code of a program for a programmable controller, thereby generating a machine language object, the development support device comprising: a compiler which stores, in an initial variable storage area in a memory area in the programmable controller, an initial variable in a program organization unit with variables included in the source code written with the program organization unit, and an additional variable storage address indicating an address of an additional variable storage area for storing a variable added to the program organization unit, determines whether a variable has been added to the program organizational unit, upon determining that a variable has been added to the program organization unit, stores all additional variables associated with the program organization unit with the added variable in the additional variable storage area in the storage area, and compiles the source code, creating the machine language object; a variable addition information generator which, upon determining that a variable has been added to the program organization unit, includes a source address and a destination address of the additional variable storage area for the program organization unit with the added variable; and a communicator which transmits the machine language object and the variable addition information to the programmable controller, wherein the compiler, when compiling the source code, generates memory allocation information indicating an allocation of the memory area for the program organization unit and variable information indicating a variable contained in the program organization unit, compares the memory allocation information and the variable information of the program before an update with the generated memory allocation information and the generated variable information, and determines whether a variable has been added to the program organization unit. [5] A memory allocation method to be implemented with a programmable controller, the memory allocation method comprising: Storing, in an initial variable storage area in a memory area in the programmable controller, an initial variable in a program organization unit with variables contained in a machine language object resulting from compiling source code written with the program organization unit, and an additional variable storage address specifying an address of an additional variable storage area for storing a variable added to the program organization unit, and, if a variable has been added to the program organization unit, storing all additional variables associated with the program organization unit with the added variable in the additional variable storage area in the storage area; and, when a variable has been added to the program organization unit in the machine language object for the programmable controller, defining or relocating the additional variable storage area for storing the additional variable in a free space in the storage area, and updating the additional variable storage address. [6] Program that causes a computer to act as: a compiler which stores, in an initial variable storage area in a memory area in a programmable controller, an initial variable in a program organization unit with variables included in a source code of a program for the programmable controller written with the program organization unit, and an additional variable storage address indicating an address of an additional variable storage area for storing a variable added to the program organization unit, determines whether a variable has been added to the program organizational unit, upon determining that a variable has been added to the program organization unit, stores all additional variables associated with the program organization unit with the added variable in the additional variable storage area in the storage area, and compiles the source code, creating a machine language object; a variable addition information generator which, upon determining that a variable has been added to the program organization unit, includes a source address and a destination address of the additional variable storage area for the program organization unit with the added variable; and a communicator which transmits the machine language object and the variable addition information to the programmable controller, wherein the compiler, when compiling the source code, generates memory allocation information indicating an allocation of the memory area for the program organization unit and variable information indicating a variable contained in the program organization unit, compares the memory allocation information and the variable information of the program before an update with the generated memory allocation information and the generated variable information, and determines whether a variable has been added to the program organization unit.

Citation Information

Patent Citations

  • Programmable controller system and support device therefor

    JP2012234272A